From d5820992593813c8a5636dfbc72a8a85f101ed31 Mon Sep 17 00:00:00 2001 From: bozar42 <5583771+Bozar@users.noreply.github.com> Date: Mon, 7 Sep 2020 20:01:40 +0800 Subject: [PATCH] Count passive spices instead of active ones when burying a sandworm. --- library/npc_ai/DesertAI.gd | 8 ++++---- library/npc_data/DesertData.gd | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/npc_ai/DesertAI.gd b/library/npc_ai/DesertAI.gd index 0358492..c3b61dd 100644 --- a/library/npc_ai/DesertAI.gd +++ b/library/npc_ai/DesertAI.gd @@ -165,7 +165,7 @@ func _bury_worm(id: int) -> void: for i in range(_new_DesertData.SPICE_END): if worm[i] == null: break - if _has_spice(worm[i]) and _is_active_spice(worm[i]): + if _has_spice(worm[i]) and (not _is_passive_spice(worm[i])): create_spice += _new_DesertData.BONUS_CREATE_SPICE for i in worm: @@ -196,7 +196,7 @@ func _can_bury_worm(id: int) -> bool: for i in worm: if i == null: break - if _has_spice(i) and (not _is_active_spice(i)): + if _has_spice(i) and _is_passive_spice(i): hit_point += _new_DesertData.HP_SPICE return hit_point > _new_DesertData.HP_BURY @@ -209,8 +209,8 @@ func _set_danger_zone(head: Sprite, is_danger: bool) -> void: _ref_DangerZone.set_danger_zone(i[0], i[1], is_danger) -func _is_active_spice(spice: Sprite) -> bool: - return _ref_ObjectData.verify_state(spice, _new_ObjectStateTag.ACTIVE) +func _is_passive_spice(spice: Sprite) -> bool: + return _ref_ObjectData.verify_state(spice, _new_ObjectStateTag.PASSIVE) func _has_spice(body: Sprite) -> bool: diff --git a/library/npc_data/DesertData.gd b/library/npc_data/DesertData.gd index a39b00d..0060174 100644 --- a/library/npc_data/DesertData.gd +++ b/library/npc_data/DesertData.gd @@ -4,8 +4,8 @@ const MIN_LENGTH: int = 8 const SPICE_START: int = 2 const SPICE_END: int = 5 -const CREATE_SPICE: int = 10 -const BONUS_CREATE_SPICE: int = 5 +const CREATE_SPICE: int = 15 +const BONUS_CREATE_SPICE: int = 10 const CREATE_ACTIVE_SPICE: int = 25 const HP_TURN: int = 1