-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitemSearch.js
81 lines (71 loc) · 2.33 KB
/
itemSearch.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//This contains talking and searching....
var foundItem = "";
var itemDesc = "";
var searchTimes = 0;
var talkTimes = 0;
// Search
function search(evText) {
switch (evText) {
case "Nothing":
foundItem = "Nothing";
player.name + ": Another wasted night.";
changeImg2(".eventImage img", ".eventImage", "images/event1.jpg");
break;
case "Gun":
foundItem = "Gun";
player.name + ": Just what I needed!";
changeImg2(".eventImage img", ".eventImage", "images/fight.jpg");
break;
case "Trash":
foundItem = "Trash";
player.name + ": Ugh, why me.";
changeImg2(".eventImage img", ".eventImage", "images/fight.jpg");
break;
case "A black cat carrying a dark omen.":
foundItem = "A black cat carrying a dark omen.";
itemDesc = player.name + ": This can't be good..";
changeImg2(".eventImage img", ".eventImage", "images/event2.jpg");
break;
case "You found a wad of cash on the ground.":
foundItem = "You found a bit of cash on the ground.";
itemDesc = player.name + ": One hundred Anything is something...";
player.money += 100;
changeImg2(".eventImage img", ".eventImage", "images/event2.jpg");
break;
}
}
//talk switch
function talk(evText) {
switch (evText) {
case "Hey, I think I've seen your face around here before.":
foundItem = "Hey, I think I've seen your face around here before.";
itemDesc = player.name + ": Glad I've never seen yours!";
changeImg2(".eventImage img", ".eventImage", "images/event5.jpg");
break;
case "Get outta here scum!":
foundItem = "Get outta here scum!";
itemDesc = player.name + ": Happy to Oblige";
changeImg2(".eventImage img", ".eventImage", "images/port1.jpg");
break;
}
}
//////EVENT MODAL
function modalEvent(t1, t2) {
$(".modalBody").focus();
$(".modal-card-title").text(t1);
$(".modalBody").text(t2);
$(".modalRand").text(foundItem);
$(".loanDays").text(itemDesc); //change this
$(".modal").addClass("is-active");
}
$("button.delete").click(function() {
itemDesc = "";
foundItem = "";
descriptText.innerText = "";
$(".modal").removeClass("is-active");
setTimeout(() => {}, 400);
});
function changeImg2(cls, cls2, img) {
$(cls).remove();
$(cls2).append("<img src='" + img + "'alt='images/bankjob.jpg'>");
}