Documentdoc("This requires the empire to have a specific trait.");
Argumenttrait("Trait",AT_Trait,doc="Trait to require.");
boolmeets(Object&obj,boolignoreState=false)const{
Empire@owner=obj.owner;
if(ownerisnull||!owner.valid)
returnfalse;
if(!owner.hasTrait(arguments[0].integer))
returnfalse;
returntrue;
}
};
classRequireNotTrait:Requirement{
Documentdoc("This requires the empire to not have a specific trait.");
Argumenttrait("Trait",AT_Trait,doc="Trait to require.");
boolmeets(Object&obj,boolignoreState=false)const{
Empire@owner=obj.owner;
if(ownerisnull||!owner.valid)
returnfalse;
if(!owner.hasTrait(arguments[0].integer))
returntrue;
returnfalse;
}
};
classRequireUnlockTag:Requirement{
Documentdoc("This requires the empire to have a specific unlock tag.");
Argumenttag(AT_UnlockTag,doc="The unlock tag to check. Unlock tags can be named any arbitrary thing, and will be created as specified. Use the same tag value in the UnlockTag() or similar hook that should unlock it.");
boolmeets(Object&obj,boolignoreState=false)const{
Empire@owner=obj.owner;
if(ownerisnull||!owner.valid)
returnfalse;
if(!owner.isTagUnlocked(tag.integer))
returnfalse;
returntrue;
}
};
classRequireSubsystemUnlocked:Requirement{
Documentdoc("This requires a particular subsystem to be unlocked.");
Argumentsubsystem(AT_Subsystem,doc="Identifier of the subsystem to check.");