Skip to content

Commit

Permalink
change name to GrantConditionOnShortGame
Browse files Browse the repository at this point in the history
  • Loading branch information
dnqbob committed Oct 21, 2023
1 parent 9e78a13 commit ded1257
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@

namespace OpenRA.Mods.Sp.Traits
{
[Desc("Hack: used for short game is disabled and no-base mod.")]
sealed class GrantConditionWhenEnableShortGameInfo : TraitInfo
[Desc("Grant condition when short game is enabled.",
"Used for short game is enable on no-base mod.")]
sealed class GrantConditionOnShortGameInfo : TraitInfo
{
[FieldLoader.Require]
[GrantedConditionReference]
[Desc("The condition to grant to self")]
public readonly string Condition = null;

public override object Create(ActorInitializer init) { return new GrantConditionWhenEnableShortGame(this); }
public override object Create(ActorInitializer init) { return new GrantConditionOnShortGame(this); }
}

sealed class GrantConditionWhenEnableShortGame : INotifyCreated
sealed class GrantConditionOnShortGame : INotifyCreated
{
readonly GrantConditionWhenEnableShortGameInfo info;
readonly GrantConditionOnShortGameInfo info;
int token;

public GrantConditionWhenEnableShortGame(GrantConditionWhenEnableShortGameInfo info)
public GrantConditionOnShortGame(GrantConditionOnShortGameInfo info)
{
this.info = info;
token = Actor.InvalidConditionToken;
Expand Down
4 changes: 3 additions & 1 deletion mods/sp/rules/sharedrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,9 @@ KING:
MustBeDestroyed:
RequiredForShortGame: true
-RequiresCondition:
GrantConditionWhenEnableShortGame:
Carryable:
LocalOffset: 0, 0, 700
GrantConditionOnShortGame:
Condition: shortgame-enabled
KillsSelf:
RemoveInstead: true
Expand Down

0 comments on commit ded1257

Please sign in to comment.