-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathStruct Spell Defend.j
More file actions
31 lines (26 loc) · 1.44 KB
/
Copy pathStruct Spell Defend.j
File metadata and controls
31 lines (26 loc) · 1.44 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
/// Knight
library StructSpellsSpellDefend requires Asl, StructGameClasses, StructGameGame, StructGameSpell
// TODO disable when character drops buckler
struct SpellDefend extends Spell
public static constant integer abilityId = 'A1HK'
public static constant integer favouriteAbilityId = 'A1HL'
public static constant integer classSelectionAbilityId = 'A1K5'
public static constant integer classSelectionGrimoireAbilityId = 'A1K6'
public static constant integer maxLevel = 1
private method condition takes nothing returns boolean
if (this.character().inventory().equipmentItemData(AItemType.equipmentTypeSecondaryWeapon) == 0 or not ItemTypes.itemTypeIdIsBuckler(this.character().inventory().equipmentItemData(AItemType.equipmentTypeSecondaryWeapon).itemTypeId())) then
debug call Print("Defend false")
call this.character().displayMessage(ACharacter.messageTypeError, tre("Ritter muss einen Schild tragen.", "The knight has to carry a buckler."))
return false
endif
debug call Print("Defend true")
return true
endmethod
public static method create takes Character character returns thistype
local thistype this = thistype.allocate(character, Classes.knight(), thistype.spellTypeDefault, thistype.maxLevel, thistype.abilityId, thistype.favouriteAbilityId, 0, thistype.condition, 0)
call this.addGrimoireEntry('A1K5', 'A1K6')
call this.addGrimoireEntry('A1HM', 'A1HR')
return this
endmethod
endstruct
endlibrary