Skip to content

Commit

Permalink
gui: Flying icons shouldn't trigger on dry-runs
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 committed May 19, 2022
1 parent e03728f commit 7dc6a11
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 39 deletions.
3 changes: 1 addition & 2 deletions src/dreamscape/CombatElements/PlayerEntity2.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ grow_vertical = 0
size_flags_horizontal = 3
script = ExtResource( 3 )
__meta__ = {
"_edit_group_": true,
"_edit_use_anchors_": false
"_edit_group_": true
}
defence_texture = ExtResource( 5 )

Expand Down
2 changes: 1 addition & 1 deletion src/dreamscape/Memories/DamageAll.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ func execute_memory_effect():
"subject": "boardseek",
"amount": MemoryDefinitions.DamageAll.amounts.damage_amount + upgrades,
"subject_count": "all",
"tags": ["Memory", "Blockable"],
"tags": ["Memory", "Attack"],
"filter_state_seek": [{
"filter_group": "EnemyEntities",
},],
Expand Down
77 changes: 41 additions & 36 deletions src/dreamscape/ScriptingEngine.gd
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,14 @@ func modify_damage(script: ScriptTask) -> int:
var extra_classification = "Unblocked"
if combat_entity.blocks_all_damage(modification, tags):
extra_classification = "Blocked"
IconAnimMessage.new(
"modify_damage",
extra_classification,
script.owner,
combat_entity,
tags,
script.get_property("starting_position_node"))
if not costs_dry_run():
IconAnimMessage.new(
"modify_damage",
extra_classification,
script.owner,
combat_entity,
tags,
script.get_property("starting_position_node"))
yield(cfc.get_tree().create_timer(0.01), "timeout")
var previous_damage = combat_entity.damage
retcode = combat_entity.modify_damage(
Expand Down Expand Up @@ -299,13 +300,14 @@ func assign_defence(script: ScriptTask) -> int:
if combat_entity.is_dead:
continue
var defence = calculate_assign_defence(combat_entity, script)
IconAnimMessage.new(
"assign_defence",
'',
script.owner,
combat_entity,
tags,
script.get_property("starting_position_node"))
if not costs_dry_run():
IconAnimMessage.new(
"assign_defence",
'',
script.owner,
combat_entity,
tags,
script.get_property("starting_position_node"))
# To allow effects like advantage to despawn
yield(cfc.get_tree().create_timer(0.01), "timeout")
var previous_defence = combat_entity.defence
Expand Down Expand Up @@ -384,13 +386,14 @@ func apply_effect(script: ScriptTask) -> int:
stacks_diff += -current_stacks
else:
stacks_diff = final_amount
IconAnimMessage.new(
"apply_effect",
effect_name,
script.owner,
entity,
tags,
script.get_property("starting_position_node"))
if not costs_dry_run():
IconAnimMessage.new(
"apply_effect",
effect_name,
script.owner,
entity,
tags,
script.get_property("starting_position_node"))
retcode = entity.active_effects.mod_effect(
effect_name,
final_amount,
Expand Down Expand Up @@ -710,13 +713,14 @@ func modify_pathos(script: ScriptTask) -> int:
var is_convertion = script.get_property("is_convertion", false)
var pathos = script.get_property("pathos", Terms.RUN_ACCUMULATION_NAMES.enemy)
var modification = calculate_modify_pathos(script)
IconAnimMessage.new(
"modify_pathos",
'',
script.owner,
cfc.NMAP.board.dreamer,
tags,
script.get_property("starting_position_node"))
if not costs_dry_run():
IconAnimMessage.new(
"modify_pathos",
'',
script.owner,
cfc.NMAP.board.dreamer,
tags,
script.get_property("starting_position_node"))
if type == "released":
var is_cost = script.get_property(SP.KEY_IS_COST)
if is_convertion:
Expand Down Expand Up @@ -771,13 +775,14 @@ func modify_health(script: ScriptTask) -> int:
if combat_entity.is_dead:
continue
var modification = calculate_modify_health(combat_entity, script)
IconAnimMessage.new(
"modify_health",
'',
script.owner,
combat_entity,
tags,
script.get_property("starting_position_node"))
if not costs_dry_run():
IconAnimMessage.new(
"modify_health",
'',
script.owner,
combat_entity,
tags,
script.get_property("starting_position_node"))
retcode = combat_entity.modify_health(
modification,
set_to_mod,
Expand Down Expand Up @@ -833,7 +838,7 @@ func modify_amount(script: ScriptTask) -> int:
return(retcode)

func mod_counter(script: ScriptTask) -> int:
if not "PlayCost" in script.get_property(SP.KEY_TAGS):
if not "PlayCost" in script.get_property(SP.KEY_TAGS) and not costs_dry_run():
IconAnimMessage.new(
"mod_counter",
'',
Expand Down

0 comments on commit 7dc6a11

Please sign in to comment.