diff --git a/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/DefCore.txt b/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/DefCore.txt deleted file mode 100644 index 0e85c1d68..000000000 --- a/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/DefCore.txt +++ /dev/null @@ -1,7 +0,0 @@ -[DefCore] -id=RelaunchContainer -Version=6,0 -Category=C4D_StaticBack -ClosedContainer=2 -Picture=0,0,92,92 -HideInCreator=true diff --git a/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/Graphics.png b/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/Graphics.png deleted file mode 100644 index e69712f47..000000000 Binary files a/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/Graphics.png and /dev/null differ diff --git a/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/Script.c b/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/Script.c deleted file mode 100644 index 78d7b2dca..000000000 --- a/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/Script.c +++ /dev/null @@ -1,133 +0,0 @@ -/*-- - Relaunch container - Author: Maikel - - This container holds the clonk after relaunches. - * The time the clonk is held can be specified by calling GetRelaunchRule()->SetRespawnDelay(int time). - * After that time the clonk is released and OnClonkLeftRelaunch(object clonk) is called in the scenario script. - * Optionally the clonk can choose a weapon if GetRelaunchWeaponList in the scenario script returns a valid id-array. ---*/ - -local menu; -local has_selected; - -local crew; - -// Sets the GetRelaunchRule().RelaunchTime, in seconds, the clonk is held in the container. - -// Returns the GetRelaunchRule().RelaunchTime, in seconds the clonk is held. -public func GetRelaunchTime() { return GetRelaunchRule().RelaunchTime / 36; } - -// Retrieve weapon list from scenario. -private func WeaponList() { return GameCall("RelaunchWeaponList"); } - -public func StartRelaunch(object clonk) -{ - if (!clonk) - return; - // only 1 clonk can be inside - if(crew) - return; - // save clonk for later use - crew = clonk; - clonk->Enter(this); - ScheduleCall(this, "OpenWeaponMenu", 36, 0, clonk); - AddEffect("IntTimeLimit", this, 100, 36, this); - return true; -} - -private func OpenWeaponMenu(object clonk) -{ - if (!clonk) - return; - if (!menu) - { - var weapons = WeaponList(); - if (weapons) - { - menu = CreateObject(MenuStyle_Default, nil, nil, clonk->GetOwner()); - menu->SetPermanent(); - menu->SetTitle(Format("$MsgWeapon$", GetRelaunchRule().RelaunchTime / 36)); - clonk->SetMenu(menu, true); - - if(GetType(GetRelaunchRule().LastUsedPlayerWeapons) != C4V_Array) GetRelaunchRule().LastUsedPlayerWeapons = []; - for (var weapon in weapons) - { - if(GetRelaunchRule().LastUsedPlayerWeapons[clonk->GetOwner()] != weapon) - { - menu->AddItem(weapon, weapon->GetName(), nil, this, "OnWeaponSelected", weapon); - } - } - - menu->Open(); - } - } -} - -func FxIntTimeLimitTimer(object target, effect, int fxtime) -{ - var clonk = crew; - if (!clonk) - { - RemoveObject(); - return -1; - } - if (fxtime >= GetRelaunchRule().RelaunchTime) - { - if (!has_selected && WeaponList()) - GiveWeapon(WeaponList()[Random(GetLength(WeaponList()))]); - RelaunchClonk(); - return -1; - } - if (menu) - menu->SetTitle(Format("$MsgWeapon$", (GetRelaunchRule().RelaunchTime - fxtime) / 36)); - else - PlayerMessage(clonk->GetOwner(), Format("$MsgRelaunch$", (GetRelaunchRule().RelaunchTime - fxtime) / 36)); - return 1; -} - -public func OnWeaponSelected(id weapon) -{ - if(!crew) return; - GiveWeapon(weapon); - if(GetRelaunchRule().DisableLastWeapon) GetRelaunchRule().LastUsedPlayerWeapons[crew->GetOwner()] = weapon; - has_selected = true; - // Close menu manually, to prevent selecting more weapons. - if (menu) - menu->Close(); - - if (!GetRelaunchRule().Hold) - RelaunchClonk(); - return true; -} - -private func RelaunchClonk() -{ - var clonk = crew; - // When relaunching from disabled state (i.e base respawn), reset view to clonk - if (!clonk->GetCrewEnabled()) - { - clonk->SetCrewEnabled(true); - SetCursor(clonk->GetOwner(), clonk); - SetPlrView(clonk->GetOwner(), clonk); - } - clonk->Exit(); - GameCall("OnClonkLeftRelaunch", clonk, clonk->GetOwner()); - if (menu) - menu->Close(); - PlayerMessage(clonk->GetOwner(), ""); - RemoveObject(); - return; -} - -private func GiveWeapon(id weapon_id) -{ - var newobj = CreateObjectAbove(weapon_id); - newobj->~OnRelaunchCreation(crew); - crew->Collect(newobj); - return true; -} - -public func SaveScenarioObject() { return false; } - -local Name = "$Name$"; diff --git a/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/StringTblDE.txt b/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/StringTblDE.txt deleted file mode 100644 index babe88679..000000000 --- a/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/StringTblDE.txt +++ /dev/null @@ -1,3 +0,0 @@ -Name=Relaunch container -MsgRelaunch=You will be relaunched in %d seconds. -MsgWeapon=You have %d seconds to choose a weapon. \ No newline at end of file diff --git a/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/StringTblUS.txt b/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/StringTblUS.txt deleted file mode 100644 index 04f6fccd2..000000000 --- a/planet/Objects.ocd/Goals.ocd/LastManStanding.ocd/Relaunch.ocd/StringTblUS.txt +++ /dev/null @@ -1,3 +0,0 @@ -Name=Relaunch container -MsgRelaunch=You will relaunch in %d seconds. -MsgWeapon=You have %d seconds to choose a weapon. \ No newline at end of file