Skip to content

Commit

Permalink
Count passive spices instead of active ones when burying a sandworm.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bozar committed Sep 7, 2020
1 parent 42faed4 commit d582099
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions library/npc_ai/DesertAI.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions library/npc_data/DesertData.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d582099

Please sign in to comment.