-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSuperPower.pde
57 lines (45 loc) · 1.16 KB
/
SuperPower.pde
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
class SuperPower implements BattleSystemConstants{
final String description = "describe super power with text";
// Super powers can do anything, therefore they are given the whole battle system, use cautiously
BattleSystem battleSystem;
// who has the superpower
BasicPlayer powerOwner;
// who will be victim of it
BasicPlayer opponent;
// status of the power
int status;
public SuperPower(BattleSystem _bs, BasicPlayer _a, BasicPlayer _b){
battleSystem = _bs;
powerOwner = _a;
opponent = _b;
status = UNUSED_POWER;
}
/**
* power needs to be activated
*/
public void activate(){
status = ACTIVE_POWER;
}
/**
* apply will be called every cycle.
*/
public void apply(){
if(status != ACTIVE_POWER) return;
}
public boolean isActive(){
return (status == ACTIVE_POWER);
}
}
class SkillTestWinPower extends SuperPower{
public SkillTestWinPower(BattleSystem _bs, BasicPlayer _a, BasicPlayer _b){
super(_bs, _a, _b);
}
public void apply(){
if(status != ACTIVE_POWER) return;
// example code for skilltest win power
// if(gameState == SKILL_STATE) {
// battleSystem.setWinner(powerOwner);
// status = USED_POWER;
// }
}
}