-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathStruct Spell Conquest.j
More file actions
37 lines (30 loc) · 1.59 KB
/
Copy pathStruct Spell Conquest.j
File metadata and controls
37 lines (30 loc) · 1.59 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
/// Knight
library StructSpellsSpellConquest requires Asl, StructGameClasses, StructGameSpell
struct SpellConquest extends Spell
public static constant integer abilityId = 'A1H9'
public static constant integer favouriteAbilityId = 'A1HA'
public static constant integer classSelectionAbilityId = 'A1JK'
public static constant integer classSelectionGrimoireAbilityId = 'A1JL'
public static constant integer maxLevel = 5
private static constant integer maxLevelStartValue = 1
private static constant integer maxLevelLevelValue = 1
private method condition takes nothing returns boolean
local boolean isAlly = GetUnitAllianceStateToUnit(this.character().unit(), GetSpellTargetUnit()) == bj_ALLIANCE_ALLIED
if (GetUnitLevel(GetSpellTargetUnit()) > this.level() * thistype.maxLevelLevelValue + thistype.maxLevelStartValue) then
call this.character().displayMessage(ACharacter.messageTypeError, tre("Ziel ist zu mächtig.", "Target is too powerful."))
return false
endif
return true
endmethod
public static method create takes Character character returns thistype
local thistype this = thistype.allocate(character, Classes.knight(), Spell.spellTypeNormal, thistype.maxLevel, thistype.abilityId, thistype.favouriteAbilityId, 0, thistype.condition, 0)
call this.addGrimoireEntry('A1JK', 'A1JL')
call this.addGrimoireEntry('A1GY', 'A1HF')
call this.addGrimoireEntry('A1HB', 'A1HG')
call this.addGrimoireEntry('A1HC', 'A1HH')
call this.addGrimoireEntry('A1HD', 'A1HI')
call this.addGrimoireEntry('A1HE', 'A1HJ')
return this
endmethod
endstruct
endlibrary