34class EndGameAction : IScoringAction
36 [
Attribute(
"100", UIWidgets.EditBox,
"Scoring limit",
"")]
37 protected int m_iScoreLimit;
47 protected void Execute(SCR_GameModeEndData endData)
57 override void OnPlayerScoreChanged(
int playerId, SCR_BaseScoringSystemComponent scoring)
63 if (score < m_iScoreLimit)
66 SCR_GameModeEndData endData = SCR_GameModeEndData.CreateSimple(
EGameOverTypes.ENDREASON_SCORELIMIT, winnerId: playerId);
71 override void OnFactionScoreChanged(
Faction faction, SCR_BaseScoringSystemComponent scoring)
77 if (score < m_iScoreLimit)
80 int factionIndex =
GetGame().GetFactionManager().GetFactionIndex(faction);
81 SCR_GameModeEndData endData = SCR_GameModeEndData.CreateSimple(
EGameOverTypes.ENDREASON_SCORELIMIT, winnerFactionId: factionIndex);
90 [
Attribute(
"1", UIWidgets.EditBox,
"Kill score multiplier",
category:
"Scoring: Multipliers")]
91 protected int m_iKillScoreMultiplier;
93 [
Attribute(
"-1", UIWidgets.EditBox,
"Teamkill score multiplier",
category:
"Scoring: Multipliers")]
94 protected int m_iTeamKillScoreMultiplier;
96 [
Attribute(
"0", UIWidgets.EditBox,
"Death score multiplier",
category:
"Scoring: Multipliers")]
97 protected int m_iDeathScoreMultiplier;
99 [
Attribute(
"-1", UIWidgets.EditBox,
"Suicide score multiplier",
category:
"Scoring: Multipliers")]
100 protected int m_iSuicideScoreMultiplier;
102 [
Attribute(
"1", UIWidgets.EditBox,
"Objective score multiplier",
category:
"Scoring: Multipliers")]
103 protected int m_iObjectiveScoreMultiplier;
105 [
Attribute(
"", UIWidgets.Object,
"List of actions executed when score changes.",
category:
"Scoring: Actions")]
106 protected ref array<ref IScoringAction>
m_aActions;
112 foreach (IScoringAction scoringAction :
m_aActions)
114 EndGameAction possibleAction = EndGameAction.Cast(scoringAction);
116 return possibleAction.GetScoreLimit();
119 return super.GetScoreLimit();
125 int score = info.m_iKills * m_iKillScoreMultiplier +
126 info.m_iTeamKills * m_iTeamKillScoreMultiplier +
127 info.m_iDeaths * m_iDeathScoreMultiplier +
128 info.m_iSuicides * m_iSuicideScoreMultiplier +
129 info.m_iObjectives * m_iObjectiveScoreMultiplier;
139 protected override void OnPlayerKilled(notnull SCR_InstigatorContextData instigatorContextData)
141 super.OnPlayerKilled(instigatorContextData);
144 AddDeath(instigatorContextData.GetVictimPlayerID());
146 Instigator instigator = instigatorContextData.GetInstigator();
149 if (instigator.GetInstigatorType() !=
InstigatorType.INSTIGATOR_PLAYER)
163 AddSuicide(instigatorContextData.GetVictimPlayerID());
173 AddKill(instigator.GetInstigatorPlayerID());
177 if (instigatorContextData.DoesPlayerKillCountAsTeamKill(editorKillsCount:
true))
179 AddTeamKill(instigator.GetInstigatorPlayerID());
187 super.OnGameModeEnd(
data);
194 super.OnPlayerScoreChanged(playerId, scoreInfo);
198 action.OnPlayerScoreChanged(playerId,
this);
206 super.OnFactionScoreChanged(faction, scoreInfo);
210 action.OnFactionScoreChanged(faction,
this);
ArmaReforgerScripted GetGame()
bool Execute(notnull SCR_AIGroupUtilityComponent groupUtility, vector targetPosition, SCR_AIActivitySmokeCoverFeatureProperties smokeCoverProperties, notnull array< AIAgent > avoidAgents, notnull array< AIAgent > excludeAgents, int maxPositionCount=1, SCR_AIActivityBase contextActivity=null)
override void OnGameModeEnd(SCR_GameModeEndData data)
ref SCR_SortedArray< SCR_BaseEditorAction > m_aActions
SCR_BaseGameMode GetGameMode()
void OnPlayerKilled(notnull SCR_InstigatorContextData instigatorContextData)
SCR_ECharacterControlType
What kind of controller the character or (in some cases vehicle) has, eg: AI, Player,...
SCR_ECharacterDeathStatusRelations
Get all prefabs that have the spawner data
Get all prefabs that have the spawner the given labels and are valid in the editor mode param catalogType Type to catalog to get prefabs from param editorMode Editor mode to get valid entries from param faction Faction(Optional)
EScoringActionMode
Action type.
SCR_ScoringSystemComponentClass SCR_BaseScoringSystemComponentClass BaseContainerProps()] class IScoringAction
void EndGameMode(SCR_GameModeEndData endData)
int GetPlayerScore(int playerId)
void OnFactionScoreChanged(Faction faction, SCR_ScoreInfo scoreInfo)
void OnPlayerScoreChanged(int playerId, SCR_ScoreInfo scoreInfo)
int CalculateScore(SCR_ScoreInfo info)
int GetFactionScore(notnull Faction faction)
SCR_FieldOfViewSettings Attribute