Skip to content

AutoDeath based on player power status and player credits - #2276

Open
Flactine wants to merge 14 commits into
Phobos-developers:developfrom
Flactine:AutoDeathLowPower
Open

AutoDeath based on player power status and player credits#2276
Flactine wants to merge 14 commits into
Phobos-developers:developfrom
Flactine:AutoDeathLowPower

Conversation

@Flactine

@Flactine Flactine commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Add new auto-death conditions based on the owner's power status and credits.

  • PlayerPowerStatus: The object will die if its owner's power status matches the configured state.
    • low / consumer: Trigger when the owner is in low power.
    • normal: Trigger when the owner is not in low power.
  • PlayerMoney.Max / PlayerMoney.Min: The object will die based on the owner's available credits.
    • If only PlayerMoney.Max is set, triggers when money is not above this value.
    • If only PlayerMoney.Min is set, triggers when money is not below this value.
    • If both are set, triggers when money is inside the range.

  • PlayerPowerStatus:当对象所属方的电力状态符合设定条件时,则对象死亡。
    • low / consumer:当对象所属方处于电力不足状态时触发。
    • normal:当对象所属方未处于电力不足状态时触发。
  • PlayerMoney.MaxPlayerMoney.Min:根据对象所属方的资金决定对象是否死亡。
    • 仅设置 PlayerMoney.Max 时,当资金不高于该值时触发。
    • 仅设置 PlayerMoney.Min 时,当资金不低于该值时触发。
    • 同时设置时,资金处于区间内时触发。

In rulesmd.ini:

[SOMETECHNO]                         ; TechnoType
AutoDeath.PlayerPowerStatus=none     ; enumeration (none | low/consumer | normal)
AutoDeath.PlayerMoney.Max=-1         ; integer
AutoDeath.PlayerMoney.Min=-1         ; integer
QQ20260628-232702

@Flactine Flactine changed the title Adds a new AutoDeath condition based on the owner's power status Add a new AutoDeath condition based on the owner's power status Jun 28, 2026
@phoboscn-bot

Copy link
Copy Markdown

To Chinese users:
This pull request has been mentioned on Phobos CN. There might be relevant details there:

致中文用户:
此拉取请求已在 Phobos CN 上被提及。那里可能有相关详细信息:

https://www.phoboscn.top/t/topic/603/1

@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown

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.

@DeathFishAtEase DeathFishAtEase added Needs testing ⚙️T1 T1 maintainer review is sufficient labels Jun 28, 2026
@TaranDahl

Copy link
Copy Markdown
Contributor

Note: You can use AI skill for generating Chinese docs.

Comment thread src/Ext/Techno/Body.Update.cpp Outdated

@Coronia Coronia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be better to rename the tag to none/low/full since it's been widely used in many places already

@Flactine Flactine changed the title Add a new AutoDeath condition based on the owner's power status AutoDeath based on player power status and player credits Jul 1, 2026
Comment thread src/Ext/Techno/Body.Update.cpp Outdated

@Coronia Coronia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for code style and reusablity, some tag/variable names should be changed, especially PowerStatus which already has common terminologies and is likely to be reused in the future

Comment thread src/Utilities/Enum.h
None = 0,
Normal = 1, // not low power
Low = 2, // low power
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PlayerPowerStatus -> PowerStatus
Normal -> Full

{"none", PlayerPowerStatus::None},
{"consumer", PlayerPowerStatus::Low},
{"low", PlayerPowerStatus::Low},
{"normal", PlayerPowerStatus::Normal},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove consumer since it's not a clear term here
change normal to full

this->AutoDeath_TechnosExist_Houses.Read(exINI, pSection, "AutoDeath.TechnosExist.Houses");
this->AutoDeath_PlayerPowerStatus.Read(exINI, pSection, "AutoDeath.PlayerPowerStatus");
this->AutoDeath_PlayerMoney_Max.Read(exINI, pSection, "AutoDeath.PlayerMoney.Max");
this->AutoDeath_PlayerMoney_Min.Read(exINI, pSection, "AutoDeath.PlayerMoney.Min");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename variables names to be identical with tag names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs testing ⚙️T1 T1 maintainer review is sufficient

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants