forked from team-sg/hero-mark-2
fix collection bonus
This commit is contained in:
parent
2b37a68f14
commit
fe09f34bf8
1 changed files with 5 additions and 4 deletions
|
@ -105,10 +105,10 @@ func tally_scores() -> void:
|
||||||
# collection bonus
|
# collection bonus
|
||||||
if keys >= 50:
|
if keys >= 50:
|
||||||
collection_bonus += 500
|
collection_bonus += 500
|
||||||
if shards >= 5:
|
if _get_shards() >= 5:
|
||||||
collection_bonus += 500
|
collection_bonus += 500
|
||||||
# 100% collection
|
# 100% collection
|
||||||
if keys >= 50 and shards >= 5:
|
if keys >= 50 and _get_shards() >= 5:
|
||||||
collection_bonus += 250
|
collection_bonus += 250
|
||||||
shards_collected[5] = true
|
shards_collected[5] = true
|
||||||
# 100% time bonus
|
# 100% time bonus
|
||||||
|
@ -131,6 +131,7 @@ func tally_scores() -> void:
|
||||||
perfect_bonus += 1000
|
perfect_bonus += 1000
|
||||||
# final score
|
# final score
|
||||||
final_score = score + arrows_bonus + collection_bonus + time_bonus + life_bonus + perfect_bonus
|
final_score = score + arrows_bonus + collection_bonus + time_bonus + life_bonus + perfect_bonus
|
||||||
|
print(collection_bonus)
|
||||||
Game.save()
|
Game.save()
|
||||||
|
|
||||||
|
|
||||||
|
@ -176,7 +177,7 @@ func save():
|
||||||
var save_data: Save.LevelSaveData = Save.current_file.levels[save_id]
|
var save_data: Save.LevelSaveData = Save.current_file.levels[save_id]
|
||||||
|
|
||||||
# save score and time depending on completion
|
# save score and time depending on completion
|
||||||
if shards >= 5 && keys >= 50:
|
if _get_shards() >= 5 && keys >= 50:
|
||||||
save_data.score_100 = max(save_data.score_100, final_score)
|
save_data.score_100 = max(save_data.score_100, final_score)
|
||||||
save_data.time_100 = min(save_data.time_100, time)
|
save_data.time_100 = min(save_data.time_100, time)
|
||||||
else:
|
else:
|
||||||
|
@ -230,7 +231,7 @@ func freeze_frame(time):
|
||||||
|
|
||||||
#Check if 100%ed
|
#Check if 100%ed
|
||||||
func has_collection_bonus():
|
func has_collection_bonus():
|
||||||
return shards == 5 && keys == 50
|
return _get_shards() == 5 && keys == 50
|
||||||
|
|
||||||
# called when player dies
|
# called when player dies
|
||||||
func _on_player_died() -> void:
|
func _on_player_died() -> void:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue