-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDetectedBonusAttack.java
More file actions
67 lines (58 loc) · 2.46 KB
/
DetectedBonusAttack.java
File metadata and controls
67 lines (58 loc) · 2.46 KB
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
import java.util.ArrayList;
//this class is to detected hero on which kinds of cell and it will bring what kinds of bonus to hero.
public class DetectedBonusAttack {
private static ArrayList<Heros> realHero;
private static ArrayList<Monsters> realMonster;
private static Board board;
private int heroIndex;
private int heroRow;
private int heroCol;
private Attack attack;
private static Boolean heroWin;
private static Boolean monsterWin;
public DetectedBonusAttack(ArrayList<Heros> realHero, ArrayList<Monsters> realMonster, int heroIndex, Board board){
this.realHero = realHero;
this.realMonster = realMonster;
this.heroIndex = heroIndex;
this.board = board;
heroWin = false;
getCellTypeAndAttack();
}
public static Boolean getHeroWin() {
return heroWin;
}
public static Boolean getMonsterWin() {
return monsterWin;
}
public void getCellTypeAndAttack(){
heroRow = realHero.get(heroIndex).getHeroRow();
heroCol = realHero.get(heroIndex).getHeroCol();
if(board.getStatus()[heroCol][heroRow] instanceof Bush){
int temp = realHero.get(heroIndex).getDexterity();
realHero.get(heroIndex).setDexterity(temp * 2);
attack= new Attack(realHero,realMonster,heroIndex);
heroWin = attack.getHeroWin();
monsterWin = attack.getMonsterWin();
realHero.get(heroIndex).setDexterity(temp);
} else if (board.getStatus()[heroCol][heroRow] instanceof Cave) {
int temp = realHero.get(heroIndex).getAgility();
realHero.get(heroIndex).setAgility(temp*2);
attack = new Attack(realHero,realMonster,heroIndex);
heroWin = attack.getHeroWin();
monsterWin = attack.getMonsterWin();
realHero.get(heroIndex).setAgility(temp);
} else if (board.getStatus()[heroCol][heroRow] instanceof Koulou) {
int temp = realHero.get(heroIndex).getStrength();
realHero.get(heroIndex).setStrength(temp * 2);
attack= new Attack(realHero,realMonster,heroIndex);
heroWin = attack.getHeroWin();
monsterWin = attack.getMonsterWin();
realHero.get(heroIndex).setStrength(temp);
}
else{
attack = new Attack(realHero,realMonster,heroIndex);
heroWin = attack.getHeroWin();
monsterWin = attack.getMonsterWin();
}
}
}