Phobos-developers / Phobos

Ares-compatible C&C Red Alert 2: Yuri's Revenge engine extension
GNU Lesser General Public License v3.0
254 stars 83 forks source link

New AutoDeath condition & convert when AutoDeath #1264

Open Coronia opened 1 month ago

Coronia commented 1 month ago

1 - added the following AutoDeath conditions:

2 - instead of firing AutoDeath when any condition is met, you can now set OnAnyCondition to false to make it trigger only when all conditions are met

3 - AutoDeath now support convert behavior. If the object is a unit, it will be changed into the TechnoType in Convert.AutoDeath instead of destroyed.

In rulesmd.ini:

[SOMETECHNO]                                   ; TechnoType
AutoDeath.Behavior=                            ; enumeration (kill | vanish | sell | convert), default not set
AutoDeath.OwnedByPlayer=false                  ; boolean
AutoDeath.OwnedByAI=false                      ; boolean
AutoDeath.MoneyExceed=-1                       ; integer
AutoDeath.MoneyBelow=-1                        ; integer
AutoDeath.LowPower=false                       ; boolean
AutoDeath.FullPower=false                      ; boolean
AutoDeath.PassengersExceed=-1                  ; integer
AutoDeath.PassengersBelow=-1                   ; integer
AutoDeath.OnAnyCondition=true                  ; boolean

Convert.AutoDeath=                             ; TechnoType
mbnq commented 1 month ago

Would be nice if there was also: AutoDeath.IsAI= That would work when owner of techno isn't human player.

Coronia commented 1 month ago

Thanks for the suugestion. I've added AutoDeath.OwnedByPlayer and AutoDeath.OwnedByAI

Metadorius commented 1 month ago

One way is to regroup it into the AttachEffect system, so that you can apply an AE under a given condition. That might be a huge change to the code structure.

Why not just fire a weapon on itself instead?