Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

Generic Condition-Sequence System & AutoDeath Enhancement

Open Coronia opened this issue 1 year ago • 1 comments

Derived from https://github.com/Phobos-developers/Phobos/pull/1264

With more conditions being added to AutoDeath and others, the code stucture is hard to maintain and the reusability is low. Hence I've experimented on the so-called 'Condition-Sequence System' from the feedback, which aimming at making all these conditions in a unified group that can be further extended. The first step is to move all of the AutoDeath conditions into this ConditionGroup

This pull request also contains all functions from 1264, as a demontration of how the new system is being used

In rulesmd.ini:

[SOMETECHNO]                                   ; TechnoType
AutoDeath.Behavior=                            ; enumeration (kill | vanish | sell | convert), default not set
AutoDeath.Weapon=                              ; WeaponType
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.AbovePercent=                        ; floating point value, percents or absolute (0.0-1.0)
AutoDeath.BelowPercent=                        ; floating point value, percents or absolute (0.0-1.0)
AutoDeath.PassengersExceed=-1                  ; integer
AutoDeath.PassengersBelow=-1                   ; integer
AutoDeath.OnAnyCondition=true                  ; boolean

Convert.AutoDeath=                             ; TechnoType

Coronia avatar Aug 09 '24 18:08 Coronia

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

github-actions[bot] avatar Aug 09 '24 18:08 github-actions[bot]