commit 1abe3efd366ed2982677cac11a9bfeb89c27e50f Author: cclecle Date: Wed May 24 17:01:45 2023 +0100 first commit diff --git a/Classes/ICCME_EventBase.uc b/Classes/ICCME_EventBase.uc new file mode 100644 index 0000000..529b865 --- /dev/null +++ b/Classes/ICCME_EventBase.uc @@ -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$"]"@"====="); +} \ No newline at end of file diff --git a/Classes/ICCME_EventListenerBase.uc b/Classes/ICCME_EventListenerBase.uc new file mode 100644 index 0000000..776cb92 --- /dev/null +++ b/Classes/ICCME_EventListenerBase.uc @@ -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 ar_UUIDBefore; +var array 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(); +} diff --git a/Classes/ICCME_Event_CTFGameBase.uc b/Classes/ICCME_Event_CTFGameBase.uc new file mode 100644 index 0000000..34b8c69 --- /dev/null +++ b/Classes/ICCME_Event_CTFGameBase.uc @@ -0,0 +1,2 @@ +class ICCME_Event_CTFGameBase extends ICCME_EventBase + abstract; diff --git a/Classes/ICCME_Event_CTFGame_FlagBase.uc b/Classes/ICCME_Event_CTFGame_FlagBase.uc new file mode 100644 index 0000000..1e9c680 --- /dev/null +++ b/Classes/ICCME_Event_CTFGame_FlagBase.uc @@ -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); +} + diff --git a/Classes/ICCME_Event_CTFGame_Flag_Captured.uc b/Classes/ICCME_Event_CTFGame_Flag_Captured.uc new file mode 100644 index 0000000..3cbd809 --- /dev/null +++ b/Classes/ICCME_Event_CTFGame_Flag_Captured.uc @@ -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 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 +} \ No newline at end of file diff --git a/Classes/ICCME_Event_Game_TimeLimit.uc b/Classes/ICCME_Event_Game_TimeLimit.uc new file mode 100644 index 0000000..c0faaca --- /dev/null +++ b/Classes/ICCME_Event_Game_TimeLimit.uc @@ -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 +} \ No newline at end of file diff --git a/Classes/ICCME_Event_Game_TimeLimit_Reached.uc b/Classes/ICCME_Event_Game_TimeLimit_Reached.uc new file mode 100644 index 0000000..cfbbe7d --- /dev/null +++ b/Classes/ICCME_Event_Game_TimeLimit_Reached.uc @@ -0,0 +1,6 @@ +class ICCME_Event_Game_TimeLimit_Reached extends ICCME_Event_Game_TimeLimit; + +defaultproperties +{ + RemainingTime=0 +} \ No newline at end of file diff --git a/Classes/ICCME_Event_TeamGameBase.uc b/Classes/ICCME_Event_TeamGameBase.uc new file mode 100644 index 0000000..6f31e87 --- /dev/null +++ b/Classes/ICCME_Event_TeamGameBase.uc @@ -0,0 +1,10 @@ +class ICCME_Event_TeamGameBase extends ICCME_EventBase + abstract; + +var TeamInfo ti; + +function doLog() +{ + super.doLog(); + log("ti:"@ti); +} \ No newline at end of file diff --git a/Classes/ICCME_Event_TeamGame_Dominating.uc b/Classes/ICCME_Event_TeamGame_Dominating.uc new file mode 100644 index 0000000..5eb7ba2 --- /dev/null +++ b/Classes/ICCME_Event_TeamGame_Dominating.uc @@ -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); +} \ No newline at end of file diff --git a/Classes/ICCME_Event_TeamGame_Lead.uc b/Classes/ICCME_Event_TeamGame_Lead.uc new file mode 100644 index 0000000..8f49739 --- /dev/null +++ b/Classes/ICCME_Event_TeamGame_Lead.uc @@ -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); +} \ No newline at end of file diff --git a/Classes/ICCME_Event_TeamGame_PlayerJoinTeam.uc b/Classes/ICCME_Event_TeamGame_PlayerJoinTeam.uc new file mode 100644 index 0000000..078d108 --- /dev/null +++ b/Classes/ICCME_Event_TeamGame_PlayerJoinTeam.uc @@ -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); +} \ No newline at end of file diff --git a/Classes/ICCME_Event_TeamGame_PlayerLeftTeam.uc b/Classes/ICCME_Event_TeamGame_PlayerLeftTeam.uc new file mode 100644 index 0000000..f8130c5 --- /dev/null +++ b/Classes/ICCME_Event_TeamGame_PlayerLeftTeam.uc @@ -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); +} \ No newline at end of file diff --git a/Classes/ICCME_Event_TeamGame_PlayerSwitchTeam.uc b/Classes/ICCME_Event_TeamGame_PlayerSwitchTeam.uc new file mode 100644 index 0000000..ee3ff0b --- /dev/null +++ b/Classes/ICCME_Event_TeamGame_PlayerSwitchTeam.uc @@ -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); +} \ No newline at end of file diff --git a/Classes/ICCME_Event_TeamGame_Score.uc b/Classes/ICCME_Event_TeamGame_Score.uc new file mode 100644 index 0000000..561019a --- /dev/null +++ b/Classes/ICCME_Event_TeamGame_Score.uc @@ -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); +} \ No newline at end of file diff --git a/Classes/ICCME_Event_TeamGame_Win.uc b/Classes/ICCME_Event_TeamGame_Win.uc new file mode 100644 index 0000000..fb38a66 --- /dev/null +++ b/Classes/ICCME_Event_TeamGame_Win.uc @@ -0,0 +1 @@ +class ICCME_Event_TeamGame_Win extends ICCME_Event_TeamGameBase; diff --git a/Classes/ICCME_GameStateBase.uc b/Classes/ICCME_GameStateBase.uc new file mode 100644 index 0000000..93747f8 --- /dev/null +++ b/Classes/ICCME_GameStateBase.uc @@ -0,0 +1,64 @@ +class ICCME_GameStateBase extends Object + abstract; + +// Interface definition +function ICCME_EventListenerBase API_AddEventListeners(class 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__ in ServerPackages"); + Warn("ChaChaMutEngineV__.CCME_Mut in Mutator list"); + Warn(" must match on both IChaChaMutEngine and ChaChaMutEngine"); + Warn("=> DO NOT load ChaChaMutEngineVx_y_z.CCME_Mut as an Actor !"); + Warn("==========================================================="); +} \ No newline at end of file diff --git a/Classes/ICCME_MutBase.uc b/Classes/ICCME_MutBase.uc new file mode 100644 index 0000000..ac68b5c --- /dev/null +++ b/Classes/ICCME_MutBase.uc @@ -0,0 +1,10 @@ +class ICCME_MutBase extends Mutator + abstract; + +function ICCME_GameStateBase GetInstance(); + + +defaultproperties +{ + RemoteRole=ROLE_None +} diff --git a/Classes/ICCME_Stats_Flag.uc b/Classes/ICCME_Stats_Flag.uc new file mode 100644 index 0000000..b180783 --- /dev/null +++ b/Classes/ICCME_Stats_Flag.uc @@ -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 ar_PawnCoverRecord; + var array ar_PawnSealRecord; +}; + +var array ar_sHolderRecord; \ No newline at end of file diff --git a/Classes/ICCME_Stats_Player.uc b/Classes/ICCME_Stats_Player.uc new file mode 100644 index 0000000..3a60742 --- /dev/null +++ b/Classes/ICCME_Stats_Player.uc @@ -0,0 +1,7 @@ +class ICCME_Stats_Player extends Object; + +var Pawn P; + +defaultproperties +{ +} diff --git a/Classes/ICCME_Stats_Player_CTFGame.uc b/Classes/ICCME_Stats_Player_CTFGame.uc new file mode 100644 index 0000000..2152d52 --- /dev/null +++ b/Classes/ICCME_Stats_Player_CTFGame.uc @@ -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; \ No newline at end of file diff --git a/Classes/ICCME_Stats_Player_DeathMatch.uc b/Classes/ICCME_Stats_Player_DeathMatch.uc new file mode 100644 index 0000000..11ed4c4 --- /dev/null +++ b/Classes/ICCME_Stats_Player_DeathMatch.uc @@ -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 ar_Event_TakeDamage; +var array 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 +} diff --git a/Classes/ICCME_Stats_Player_TeamGame.uc b/Classes/ICCME_Stats_Player_TeamGame.uc new file mode 100644 index 0000000..f159389 --- /dev/null +++ b/Classes/ICCME_Stats_Player_TeamGame.uc @@ -0,0 +1 @@ +class ICCME_Stats_Player_TeamGame extends ICCME_Stats_Player_DeathMatch; \ No newline at end of file diff --git a/make.bat b/make.bat new file mode 100644 index 0000000..133a8e0 --- /dev/null +++ b/make.bat @@ -0,0 +1,2 @@ +del %~dp0\..\System\IChaChaMutEngineV1.u +%~dp0\..\System\ucc.exe make IChaChaMutEngineV1