ArcanePariah / Night-of-the-Dead

9 stars 14 forks source link

Player lives rewamp #235

Closed NiktosNOTD closed 6 years ago

NiktosNOTD commented 6 years ago

Lives are now handled by data. It's set of behaviours for specific cases: 1.Dying to really big hits, like nuke. 2.Dying to usual dmg, mobs hitting you. 3.Dying to venom/bleed degen of hp.

In previous trigger based implementation only point 2. was working. In data aproach you can't die if you have lives.

Triggers still play a role but a smaller not important one. Changes to triggers: 1.BadlyInjured function, is now a trigger instead. It applies rating penalties when player loses life, also plays sounds, and removes live related behaviors in case player reaches 0 of them. 2.BadlyInjured trigger also got trimmed of now useless (achieved by data), and fully removed stuff (disabling of weapon/ camera shaking ect) 3.ReceivesDamage trigger no longer needs to call BadlyInjured function so it got a slight trimm also. 4.ClassCreationMaster function now, if player has lives adds behaviors to his marine on selection to achieve data driven lives functionality.

How new lives work = any way of losing life sets player to 25% of his hp and nulifies incoming damage for 5s: Player loses life ->any received dmg gets nulified -> marine hp jumps to full ->marine hp drops to 25% -> for following 5s player regens 8hp/s [during those 5s player can pass thru mobs] -> Nulifying of dmg ends along with hp regen. Jump to full hp and then to 25% is made instantly one after another thus unnoticeable, likely in same data cycle or 2 following ones so 0.0625-0.125s Like in old implementation if a player loses life near teammates, enemies will ignore him and chase teammates.

WHY: -Short version - old lives sucked, they didn't work most of time and how they were made was annoying -Long version - also why so many changes instead of simple trigger->data swap lives why

PATCHNOTES: -Greatly buffed player lives and made them consistently trigger on all types of damage.

NiktosNOTD commented 6 years ago

Got the merge conflict out of the way.

-Triggers had a slight conflict related to 'BadlyInjured' function becoming a trigger in my version. It also had small changes relating to ui(updating rating) - which were not pressent in my version and thus conflicting - resolved them manually. While resolving conflict noticed 'BadlyInjured' has 2 local vars doing same thing, removed the one occuring less times and changed it's occurences to the one remaining. [It was 2 sepparate vars both holding player index] -MapScript.galaxy recompiled itself on save anyway so no resolving in it.