first commit

This commit is contained in:
cclecle
2023-05-24 17:01:45 +01:00
commit 1abe3efd36
59 changed files with 702 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
class ICCME_EventBase extends Object
abstract;
// time the event was created (relative to game start)
var float createdTime;
// Tell the engine this event must be treated in the current Tick() context and not the next one
var bool bUrgent;
// print Event relevent informations in the main UT log file
function doLog()
{
log("===== Event:"@Self.Class@"["$createdTime$"]"@"=====");
}

View File

@@ -0,0 +1,32 @@
class ICCME_EventListenerBase extends Object
abstract;
var LevelInfo Level;
var ICCME_GameStateBase GameState;
// future Mutator ordering
var string UUID;
var array<string> ar_UUIDBefore;
var array<string> ar_UUIDAfter;
// Init function automatically called when Listener added
function Init();
// Main user function, to process incomming event.
function ProcessEvent(ICCME_EventBase Event);
// Optionnal user Tick() function
function Tick(float DeltaTime);
// Helper function to add new event in the process Queue
// => To be called from ProcessEvent()
function AddEvent(ICCME_Event_CustomBase Event)
{
GameState.API_AddCustomPostEvent(Event);
}
// Helper function to force check EndGame conditions (During OverTime)
// => To be called from ProcessEvent()
function CheckEndGame()
{
GameState.API_CheckEndGame();
}

View File

@@ -0,0 +1,2 @@
class ICCME_Event_CTFGameBase extends ICCME_EventBase
abstract;

View File

@@ -0,0 +1,29 @@
class ICCME_Event_CTFGame_FlagBase extends ICCME_Event_CTFGameBase
abstract;
var enum T_eType{
FLAG_CAPTURED,
FLAG_DROPPED,
FLAG_TAKEN,
FLAG_RETURNED,
}eType;
var FlagBase fb;
var CTFFlag flg;
var int FlagIdx;
var bool ReTaken;
var ICCME_Stats_Flag FlagStats;
function doLog()
{
super.doLog();
log("eType:"@eType);
log("fb:"@fb);
log("flg:"@flg);
log("FlagIdx:"@FlagIdx);
log("ReTaken:"@ReTaken);
log("FlagStats:"@FlagStats);
}

View File

@@ -0,0 +1,28 @@
class ICCME_Event_CTFGame_Flag_Captured extends ICCME_Event_CTFGame_FlagBase;
function doLog()
{
local int i;
super.doLog();
log("==== FLAG CAP RECORD ====");
for(i=0;i<FlagStats.ar_sHolderRecord.Length;i++)
{
log("** HOLDER N."@i@"**");
log("Holder: "@FlagStats.ar_sHolderRecord[i].Holder);
log("Killer: "@FlagStats.ar_sHolderRecord[i].Killer);
log("TimeTaken: "@ FlagStats.ar_sHolderRecord[i].TimeTaken);
log("TimeCaptured: "@ FlagStats.ar_sHolderRecord[i].TimeCaptured);
log("TimeReturned: "@ FlagStats.ar_sHolderRecord[i].TimeReturned);
log("TimeDropped: "@ FlagStats.ar_sHolderRecord[i].TimeDropped);
}
log("=========================");
}
defaultproperties
{
eType=FLAG_CAPTURED
}

View File

@@ -0,0 +1,6 @@
class ICCME_Event_CTFGame_Flag_Dropped extends ICCME_Event_CTFGame_FlagBase;
defaultproperties
{
eType=FLAG_DROPPED
}

View File

@@ -0,0 +1,6 @@
class ICCME_Event_CTFGame_Flag_Returned extends ICCME_Event_CTFGame_FlagBase;
defaultproperties
{
eType=FLAG_Returned
}

View File

@@ -0,0 +1,6 @@
class ICCME_Event_CTFGame_Flag_Taken extends ICCME_Event_CTFGame_FlagBase;
defaultproperties
{
eType=FLAG_TAKEN
}

View File

@@ -0,0 +1,12 @@
class ICCME_Event_CTFGame_PlayerBase extends ICCME_Event_CTFGameBase
abstract;
var ICCME_Stats_Player_CTFGame ReleventPlayerStats;
var ICCME_Event_CTFGame_FlagBase ReleventFlagEvent;
function doLog()
{
super.doLog();
log("ReleventPlayerStats:"@ReleventPlayerStats);
log("ReleventFlagEvent:"@ReleventFlagEvent);
}

View File

@@ -0,0 +1,10 @@
class ICCME_Event_CTFGame_PlayerKillBase extends ICCME_Event_CTFGameBase
abstract;
var ICCME_Event_DeathMatch_Kill Revelent_KillEvent;
function doLog()
{
super.doLog();
log("Revelent_KillEvent:"@Revelent_KillEvent);
}

View File

@@ -0,0 +1,3 @@
class ICCME_Event_CTFGame_PlayerKill_Cover extends ICCME_Event_CTFGame_PlayerKillBase;
var ICCME_Stats_Player_CTFGame Relevent_HolderStats;

View File

@@ -0,0 +1,8 @@
class ICCME_Event_CTFGame_PlayerKill_Defend extends ICCME_Event_CTFGame_PlayerKillBase;
var bool bisSeal;
defaultproperties
{
bisSeal=False
}

View File

@@ -0,0 +1,6 @@
class ICCME_Event_CTFGame_PlayerKill_Denied extends ICCME_Event_CTFGame_PlayerKill_FlagKill;
defaultproperties
{
bisDenied=True
}

View File

@@ -0,0 +1,8 @@
class ICCME_Event_CTFGame_PlayerKill_FlagKill extends ICCME_Event_CTFGame_PlayerKillBase;
var bool bisDenied;
defaultproperties
{
bisDenied=False
}

View File

@@ -0,0 +1,6 @@
class ICCME_Event_CTFGame_PlayerKill_Seal extends ICCME_Event_CTFGame_PlayerKill_Defend;
defaultproperties
{
bisSeal=True
}

View File

@@ -0,0 +1 @@
class ICCME_Event_CTFGame_Player_CapturedFlag extends ICCME_Event_CTFGame_PlayerBase;

View File

@@ -0,0 +1 @@
class ICCME_Event_CTFGame_Player_DroppedFlag extends ICCME_Event_CTFGame_PlayerBase;

View File

@@ -0,0 +1 @@
class ICCME_Event_CTFGame_Player_HasFlag extends ICCME_Event_CTFGame_PlayerBase;

View File

@@ -0,0 +1,4 @@
class ICCME_Event_CTFGame_Player_ReturnedFlag extends ICCME_Event_CTFGame_PlayerBase;
var bool bInEnemyBase;
var bool bInOwnBase;

View File

@@ -0,0 +1 @@
class ICCME_Event_CTFGame_Player_Save extends ICCME_Event_CTFGame_Player_ReturnedFlag;

View File

@@ -0,0 +1,2 @@
class ICCME_Event_CustomBase extends ICCME_EventBase
abstract;

View File

@@ -0,0 +1,2 @@
class ICCME_Event_DeathMatchBase extends ICCME_EventBase
abstract;

View File

@@ -0,0 +1,19 @@
class ICCME_Event_DeathMatch_Death extends ICCME_Event_DeathMatchBase;
var Pawn Victim;
var ICCME_Stats_Player_DeathMatch VictimStats;
var Pawn Killer;
var ICCME_Stats_Player_DeathMatch KillerStats;
var name DamageType;
var vector HitLocation;
function doLog()
{
super.doLog();
log("Victim:"@Victim);
log("VictimStats:"@VictimStats);
log("Killer:"@Killer);
log("KillerStats:"@KillerStats);
log("DamageType:"@DamageType);
log("HitLocation:"@HitLocation);
}

View File

@@ -0,0 +1,10 @@
class ICCME_Event_DeathMatch_GloryBase extends ICCME_Event_DeathMatchBase
abstract;
var ICCME_Event_DeathMatch_Kill Relevent_KillEvent;
function doLog()
{
super.doLog();
log("Relevent_KillEvent:"@Relevent_KillEvent);
}

View File

@@ -0,0 +1,9 @@
class ICCME_Event_DeathMatch_Glory_HeadHunter extends ICCME_Event_DeathMatch_GloryBase;
var int HeadHunterLevel;
function doLog()
{
super.doLog();
log("HeadHunterLevel:"@HeadHunterLevel);
}

View File

@@ -0,0 +1,9 @@
class ICCME_Event_DeathMatch_Glory_KillSpree extends ICCME_Event_DeathMatch_GloryBase;
var int SpreeLevel;
function doLog()
{
super.doLog();
log("SpreeLevel:"@SpreeLevel);
}

View File

@@ -0,0 +1,3 @@
class ICCME_Event_DeathMatch_Glory_KillSpree_End extends ICCME_Event_DeathMatch_GloryBase;
var ICCME_Event_DeathMatch_Death Relevent_DeathEvent; //In case Player end his own killspree

View File

@@ -0,0 +1,10 @@
class ICCME_Event_DeathMatch_Glory_MultiKill extends ICCME_Event_DeathMatch_GloryBase;
var int MultiKillLevel;
function doLog()
{
super.doLog();
log("MultiKillLevel:"@MultiKillLevel);
}

View File

@@ -0,0 +1,28 @@
class ICCME_Event_DeathMatch_Kill extends ICCME_Event_DeathMatchBase;
var bool bIsFirstBlood;
var bool bIsFriendKill;
var bool bIsMutualKill;
var bool bIsVengeance;
var bool bIsHeadShot;
var ICCME_Event_DeathMatch_Death Relevent_DeathEvent;
function doLog()
{
super.doLog();
log("bIsFirstBlood:"@bIsFirstBlood);
log("bIsFriendKill:"@bIsFriendKill);
log("bIsMutualKill:"@bIsMutualKill);
log("bIsVengeance:"@bIsVengeance);
log("bIsHeadShot:"@bIsHeadShot);
log("Relevent_DeathEvent:"@Relevent_DeathEvent);
}
defaultproperties{
bIsFirstBlood=False
bIsFriendKill=False
bIsMutualKill=False
bIsVengeance=False
bIsHeadShot=False
}

View File

@@ -0,0 +1,21 @@
class ICCME_Event_DeathMatch_PotentialDeath extends ICCME_Event_DeathMatchBase;
var Pawn Victim;
var ICCME_Stats_Player_DeathMatch VictimStats;
var Pawn Killer;
var ICCME_Stats_Player_DeathMatch KillerStats;
var name DamageType;
var vector HitLocation;
var bool bPreventDeath;
function doLog()
{
super.doLog();
log("Victim:"@Victim);
log("VictimStats:"@VictimStats);
log("Killer:"@Killer);
log("KillerStats:"@KillerStats);
log("DamageType:"@DamageType);
log("HitLocation:"@HitLocation);
log("bPreventDeath:"@bPreventDeath);
}

View File

@@ -0,0 +1 @@
class ICCME_Event_DeathMatch_Suicide extends ICCME_Event_DeathMatch_Death;

View File

@@ -0,0 +1,23 @@
class ICCME_Event_DeathMatch_TakeDamage extends ICCME_Event_DeathMatchBase;
var int ActualDamage;
var Pawn Victim;
var ICCME_Stats_Player_DeathMatch VictimStats;
var Pawn InstigatedBy;
var ICCME_Stats_Player_DeathMatch InstigatorStats;
var Vector HitLocation;
var Vector Momentum;
var name DamageType;
function doLog()
{
super.doLog();
log("ActualDamage:"@ActualDamage);
log("Victim:"@Victim);
log("VictimStats:"@VictimStats);
log("InstigatedBy:"@InstigatedBy);
log("InstigatorStats:"@InstigatorStats);
log("HitLocation:"@HitLocation);
log("Momentum:"@Momentum);
log("DamageType:"@DamageType);
}

View File

@@ -0,0 +1,9 @@
class ICCME_Event_DeathMatch_Win extends ICCME_Event_DeathMatchBase;
var ICCME_Stats_Player_DeathMatch ReleventPlayerStats;
function doLog()
{
super.doLog();
log("ReleventPlayerStats:"@ReleventPlayerStats);
}

View File

@@ -0,0 +1,2 @@
class ICCME_Event_GameBase extends ICCME_EventBase
abstract;

View File

@@ -0,0 +1 @@
class ICCME_Event_Game_GameEnded extends ICCME_Event_GameBase;

View File

@@ -0,0 +1 @@
class ICCME_Event_Game_GameOverTime extends ICCME_Event_GameBase;

View File

@@ -0,0 +1 @@
class ICCME_Event_Game_GameStarted extends ICCME_Event_GameBase;

View File

@@ -0,0 +1,15 @@
class ICCME_Event_Game_PlayerJoin extends ICCME_Event_GameBase;
var ICCME_Stats_Player ReleventPlayerStats;
var bool bIsSpectating;
var bool bIsABot;
var bool bIsReconnect;
function doLog()
{
super.doLog();
log("bIsSpectating:"@bIsSpectating);
log("bIsABot:"@bIsABot);
log("bIsReconnect:"@bIsReconnect);
}

View File

@@ -0,0 +1,29 @@
class ICCME_Event_Game_PlayerLeft extends ICCME_Event_GameBase;
var ICCME_Stats_Player ReleventPlayerStats;
var bool bIsSpectating;
var bool bIsABot;
var string PlayerName;
var int PlayerID;
var string TeamName;
var byte Team;
var float Score;
var float Deaths;
var string Ip;
var bool bHasSpawned;
function doLog()
{
super.doLog();
log("bIsSpectating:"@bIsSpectating);
log("bIsABot:"@bIsABot);
log("PlayerName:"@PlayerName);
log("PlayerID:"@PlayerID);
log("TeamName:"@TeamName);
log("Team:"@Team);
log("Score:"@Score);
log("Deaths:"@Deaths);
log("Ip:"@Ip);
log("bHasSpawned:"@bHasSpawned);
}

View File

@@ -0,0 +1,14 @@
class ICCME_Event_Game_PlayerSpawned extends ICCME_Event_GameBase;
var ICCME_Stats_Player ReleventPlayerStats;
var bool bIsABot;
var bool bIsFirstSpawn;
function doLog()
{
super.doLog();
log("ReleventPlayerStats:"@ReleventPlayerStats);
log("bIsABot:"@bIsABot);
log("bIsFirstSpawn:"@bIsFirstSpawn);
}

View File

@@ -0,0 +1,59 @@
class ICCME_Event_Game_PotentialGameEnded extends ICCME_Event_GameBase;
// ============================================================================
// Arg Name: bManagedOverTime
// Type: Boolean
// ----------------------------------------------------------------------------
// This variable indicate if the current event comes from a Managed OverTime
// detection.
// /!\ To use it user must have bEnableOvertimeControl set to true in
// ChaChaMutatorEngine.ini.
// ----------------------------------------------------------------------------
var bool bManagedOverTime;
// ----------------------------------------------------------------------------
// ============================================================================
// Arg Name: bEndGame
// Type: Boolean
// ----------------------------------------------------------------------------
// This variable is both an indicator and a control value. The initial value is
// what the Engine is going to do but Modder can change it in its own Mut.
//
// /!\ This variable has two close but different meanings
// de pending on bManagedOverTime:
//
// * If bManagedOverTime is True:
// Then bEndGame is controlling ChaChaMutEngine Own OverTime.
// => That mean you can set it to True to force not having OverTime, or False to
// not have one.
// /!\ CCME's OverTime can only be triggered once, Then at any Valid score
// encoutered, the engine will stop game / display score.
//
// * If bManagedOverTime is False:
// Then bEndGame is bind to the HandleEndGame() function from standard Mutator
// API. In such case, modders can use bManagedOverTime to fast-close a
// challenge. The main UT's engine calls this function at every end-Score
// (during normal gameplay, either when goal score reached, or if time limit
// reached), or at any score during overtime.
// This is the reason ManagedOverTime exists in CCME: The internal
// implementation does not let us choose when to refuse ac end-score and force
// to go in OverTime. It only let use the opportunity to fast quit The
// challenge.
// => That mean you can instant close game / no end score display,
// by setting this variable to True when you receive it.
// ----------------------------------------------------------------------------
var bool bEndGame;
// ----------------------------------------------------------------------------
function doLog()
{
super.doLog();
log("bManagedOverTime:"@bManagedOverTime);
log("bEndGame:"@bEndGame);
}
defaultproperties
{
bEndGame=True
}

View File

@@ -0,0 +1,14 @@
class ICCME_Event_Game_TimeLimit extends ICCME_Event_GameBase;
var int RemainingTime;
function doLog()
{
super.doLog();
log("RemainingTime:"@RemainingTime);
}
defaultproperties
{
RemainingTime=300
}

View File

@@ -0,0 +1,6 @@
class ICCME_Event_Game_TimeLimit_Reached extends ICCME_Event_Game_TimeLimit;
defaultproperties
{
RemainingTime=0
}

View File

@@ -0,0 +1,10 @@
class ICCME_Event_TeamGameBase extends ICCME_EventBase
abstract;
var TeamInfo ti;
function doLog()
{
super.doLog();
log("ti:"@ti);
}

View File

@@ -0,0 +1,9 @@
class ICCME_Event_TeamGame_Dominating extends ICCME_Event_TeamGameBase;
var ICCME_Event_TeamGame_Score RelatedScore;
function doLog()
{
super.doLog();
log("RelatedScore:"@RelatedScore);
}

View File

@@ -0,0 +1,9 @@
class ICCME_Event_TeamGame_Lead extends ICCME_Event_TeamGameBase;
var ICCME_Event_TeamGame_Score RelatedScore;
function doLog()
{
super.doLog();
log("RelatedScore:"@RelatedScore);
}

View File

@@ -0,0 +1,16 @@
class ICCME_Event_TeamGame_PlayerJoinTeam extends ICCME_Event_TeamGameBase;
var Pawn Player;
var bool bReJoin;
var bool bIsSwitch;
var ICCME_Event_Game_PlayerJoin Related_PlayerJoin;
function doLog()
{
super.doLog();
log("Player:"@Player);
log("bReJoin:"@bReJoin);
log("bIsSwitch:"@bIsSwitch);
log("Related_PlayerJoin:"@Related_PlayerJoin);
}

View File

@@ -0,0 +1,13 @@
class ICCME_Event_TeamGame_PlayerLeftTeam extends ICCME_Event_TeamGameBase;
var Pawn Player;
var bool bIsSwitch;
var ICCME_Event_Game_PlayerLeft Related_PlayerLeft;
function doLog()
{
super.doLog();
log("Player:"@Player);
log("bIsSwitch:"@bIsSwitch);
log("Related_PlayerLeft:"@Related_PlayerLeft);
}

View File

@@ -0,0 +1,11 @@
class ICCME_Event_TeamGame_PlayerSwitchTeam extends ICCME_Event_TeamGameBase;
var ICCME_Event_TeamGame_PlayerJoinTeam Relevent_PlayerJoinTeam;
var ICCME_Event_TeamGame_PlayerLeftTeam Relevent_PlayerLeftTeam;
function doLog()
{
super.doLog();
log("Relevent_PlayerJoinTeam:"@Relevent_PlayerJoinTeam);
log("Relevent_PlayerLeftTeam:"@Relevent_PlayerLeftTeam);
}

View File

@@ -0,0 +1,11 @@
class ICCME_Event_TeamGame_Score extends ICCME_Event_TeamGameBase;
var bool bLeading;
var bool bDominating;
function doLog()
{
super.doLog();
log("bLeading:"@bLeading);
log("bDominating:"@bDominating);
}

View File

@@ -0,0 +1 @@
class ICCME_Event_TeamGame_Win extends ICCME_Event_TeamGameBase;

View File

@@ -0,0 +1,64 @@
class ICCME_GameStateBase extends Object
abstract;
// Interface definition
function ICCME_EventListenerBase API_AddEventListeners(class<ICCME_EventListenerBase> TEventListener);
function API_AddCustomPostEvent(ICCME_Event_CustomBase Event);
function API_CheckEndGame();
// Static helpers libs
static function ICCME_GameStateBase GetInstance(LevelInfo BaseLevel)
{
local ICCME_MutBase A_ICCME_Mut;
local Mutator MNext;
local int nBInstances;
nBInstances = 0;
MNext=BaseLevel.Game.BaseMutator;
while(MNext!=None)
{
if(ICCME_MutBase(MNext)!=None)
{
A_ICCME_Mut=ICCME_MutBase(MNext);
nBInstances++;
}
MNext=MNext.NextMutator;
}
if(nBInstances>1)
{
Warn("===========================================================");
Warn("Found Multiple instance of CCME_Mut...");
Warn("This is not supported, Check your installation / config");
Warn("Loading Aborded");
Warn("===========================================================");
DisplayHelp();
return None;
}
if(A_ICCME_Mut!=None)
{
return A_ICCME_Mut.GetInstance();
}
Warn("===========================================================");
Warn("!! Can not found CCME_Mut :-/ !!");
Warn("Loading Aborded");
Warn("===========================================================");
DisplayHelp();
return None;
}
static function DisplayHelp()
{
Warn("===========================================================");
Warn("!! ChaChaMutEngine Installation Reminder");
Warn("IChaChaMutEngineVx in ServerPackages");
Warn("ChaChaMutEngineV<x>_<y>_<z> in ServerPackages");
Warn("ChaChaMutEngineV<x>_<y>_<z>.CCME_Mut in Mutator list");
Warn("<x> must match on both IChaChaMutEngine and ChaChaMutEngine");
Warn("=> DO NOT load ChaChaMutEngineVx_y_z.CCME_Mut as an Actor !");
Warn("===========================================================");
}

10
Classes/ICCME_MutBase.uc Normal file
View File

@@ -0,0 +1,10 @@
class ICCME_MutBase extends Mutator
abstract;
function ICCME_GameStateBase GetInstance();
defaultproperties
{
RemoteRole=ROLE_None
}

View File

@@ -0,0 +1,14 @@
class ICCME_Stats_Flag extends Object;
struct T_sHolderRecord{
var Pawn Holder;
var Pawn Killer;
var float TimeTaken;
var float TimeDropped;
var float TimeCaptured;
var float TimeReturned;
var array<Pawn> ar_PawnCoverRecord;
var array<Pawn> ar_PawnSealRecord;
};
var array<T_sHolderRecord> ar_sHolderRecord;

View File

@@ -0,0 +1,7 @@
class ICCME_Stats_Player extends Object;
var Pawn P;
defaultproperties
{
}

View File

@@ -0,0 +1,18 @@
class ICCME_Stats_Player_CTFGame extends ICCME_Stats_Player_TeamGame;
var int NbFlagCaptured;
var int NbFlagTaken;
var int NbFlagReturned;
var int NbFlagDropped;
var int NbFlagKill;
var int NbDenied;
var int NbCover;
var int NbDefense;
var int NbSeal;
var int NbSave;
var int NbAssit;
var int CoverSpreeLevel;
var int DefenseSpreeLevel;
var int SealSpreeLevel;

View File

@@ -0,0 +1,34 @@
class ICCME_Stats_Player_DeathMatch extends ICCME_Stats_Player;
var int MultiKillLevel;
var int KillSpreeLevel;
var int HeadShotSpreeLevel;
var int SuicideNum;
var int KillNum;
var int FriendKillNum;
var int DeathNum;
var int HeadShotNum;
var float LastKillTime;
var float LastKilledTime;
var Pawn LastKiller;
var Pawn LastVictim;
var array<ICCME_Event_DeathMatch_TakeDamage> ar_Event_TakeDamage;
var array<ICCME_Event_DeathMatch_PotentialDeath> ar_Event_PotentialDeath;
defaultproperties
{
MultiKillLevel=0
KillSpreeLevel=0
HeadShotSpreeLevel=0
SuicideNum=0
KillNum=0
FriendKillNum=0
DeathNum=0
HeadShotNum=0
LastKillTime=-1.f
LastKilledTime=-1.f
LastKiller=None
LastVictim=None
}

View File

@@ -0,0 +1 @@
class ICCME_Stats_Player_TeamGame extends ICCME_Stats_Player_DeathMatch;

2
make.bat Normal file
View File

@@ -0,0 +1,2 @@
del %~dp0\..\System\IChaChaMutEngineV1.u
%~dp0\..\System\ucc.exe make IChaChaMutEngineV1