-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
respawn added for falling down as undead of when in death realm; addi…
…tions to planner knowledge (shield, stamina), not added logic to actions yet; grant spells on skill allocation
- Loading branch information
Showing
26 changed files
with
216 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
characters/state/ai/actions/spell_element_shield_action.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
extends abstract_action | ||
|
||
static func spell_id() -> String: | ||
return element_shield_spell.id() | ||
|
||
static func precondition() -> planner.knowledge: | ||
var spell = skill_data.spells[spell_id()] | ||
return planner.knowledge.new(spell.self_pain() + spell.self_pain_per_second() * spell.duration(), -(spell.self_focus() + spell.self_focus_per_second() * spell.duration()), 0, 0, planner.knowledge_mask.enemy_in_near) | ||
|
||
static func postcondition() -> planner.knowledge: | ||
var spell = skill_data.spells[spell_id()] | ||
return planner.knowledge.new(spell.self_pain() + spell.self_pain_per_second() * spell.duration(), spell.self_focus() + spell.self_focus_per_second() * spell.duration()) | ||
|
||
static func precondition_mask() -> int: | ||
return planner.knowledge_mask.focus | planner.knowledge_mask.focus_toggle | planner.knowledge_mask.pain | planner.knowledge_mask.enemy_in_near | ||
|
||
static func postcondition_mask() -> int: | ||
return planner.knowledge_mask.focus | planner.knowledge_mask.pain | planner.knowledge_mask.enemy_damaged | ||
|
||
func choose_target(): | ||
target = pawn.ai.brain.get_any_enemy() | ||
|
||
func get_range_state() -> int: | ||
if(!game.is_valid(target)): | ||
return range_state.unreachable | ||
var spell_range = skill_data.spells[spell_id()].range() | ||
if(spell_range < 0): | ||
return range_state.no_range_required | ||
if(pawn.global_transform.origin.distance_squared_to(target.global_transform.origin) <= spell_range * spell_range): | ||
return range_state.in_range | ||
return range_state.out_of_range | ||
|
||
func do() -> bool: | ||
pawn.face_target(target) | ||
pawn.skills.cast_spell(spell_id()) | ||
return true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
extends abstract_action | ||
|
||
static func spell_id() -> String: | ||
return summon_minion_spell.id() | ||
|
||
static func precondition() -> planner.knowledge: | ||
var spell = skill_data.spells[spell_id()] | ||
return planner.knowledge.new(spell.self_pain() + spell.self_pain_per_second() * spell.duration(), -(spell.self_focus() + spell.self_focus_per_second() * spell.duration()), 0, 0, planner.knowledge_mask.enemy_in_near) | ||
|
||
static func postcondition() -> planner.knowledge: | ||
var spell = skill_data.spells[spell_id()] | ||
return planner.knowledge.new(spell.self_pain() + spell.self_pain_per_second() * spell.duration(), spell.self_focus() + spell.self_focus_per_second() * spell.duration(), 0, 0, planner.knowledge_mask.enemy_damaged) | ||
|
||
static func precondition_mask() -> int: | ||
return planner.knowledge_mask.focus | planner.knowledge_mask.focus_toggle | planner.knowledge_mask.pain | planner.knowledge_mask.enemy_in_near | ||
|
||
static func postcondition_mask() -> int: | ||
return planner.knowledge_mask.focus | planner.knowledge_mask.pain | planner.knowledge_mask.enemy_damaged | ||
|
||
func choose_target(): | ||
target = pawn.ai.brain.get_any_enemy() | ||
|
||
func get_range_state() -> int: | ||
if(!game.is_valid(target)): | ||
return range_state.unreachable | ||
var spell_range = skill_data.spells[spell_id()].range() | ||
if(spell_range < 0): | ||
return range_state.no_range_required | ||
if(pawn.global_transform.origin.distance_squared_to(target.global_transform.origin) <= spell_range * spell_range): | ||
return range_state.in_range | ||
return range_state.out_of_range | ||
|
||
func do() -> bool: | ||
pawn.face_target(target) | ||
pawn.skills.cast_spell(spell_id()) | ||
return true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.