XelaPy / PyTFall

Open World H/Sim Game:
http://www.pinkpetal.org/
23 stars 24 forks source link

Diving: Infinite vitality #343

Closed charrednewth closed 5 years ago

charrednewth commented 5 years ago

PyTFall/game/code/locations/beach/beach.rpy

Hero can currently gain infinite vitality with diving (flag resets every time) lines 277 -> 282

label mc_action_city_beach_diving_checks:
    if not global_flags.has_flag('vitality_bonus_from_diving_at_beach'):
        $ hero.set_flag("vitality_bonus_from_diving_at_beach", value=0)
    if not global_flags.flag('diving_city_beach'):
        $ global_flags.set_flag('diving_city_beach')
#etc.   "With high enough swimming skill etc.

Simple fix:

label mc_action_city_beach_diving_checks:
    if not global_flags.flag('diving_city_beach'):
        $ hero.set_flag("vitality_bonus_from_diving_at_beach", value=0)
        $ global_flags.set_flag('diving_city_beach')
#etc.   "With high enough swimming skill etc.

Flag would be set to 0 only once, just at the first click on 'diving'.

pionere commented 5 years ago

The flag is not reset every time. It is set to zero if there is no such flag. It is incremented till 100 @line 355, otherwise not modified.

charrednewth commented 5 years ago

The flag is not reset every time. It is set to zero if there is no such flag. It is incremented till 100 @line 355, otherwise not modified.

Please test before you reply with a wrong answer: The intended check would be "if not hero.flag('diving_city_beach'):" (edit: hero.has_flag('vitality_bonus_from_diving_at_beach'), actually.)

global_flags.has_flag('vitality_bonus_from_diving_at_beach') is False and always will be...

Either way there is no point in having that "if" every single diving attempt.

pionere commented 5 years ago

sorry, you are right. A fix is committed.

charrednewth commented 5 years ago

np. Glad to be of assistance.