Parkour(Race) Goal with checkpoints(work in progress...) + Scenario(Parkour.c4f)
|
@ -0,0 +1,11 @@
|
|||
[DefCore]
|
||||
id=CKPT
|
||||
Version=4,10,0,0
|
||||
Category=C4D_StaticBack
|
||||
MaxUserSelect=1
|
||||
Width=40
|
||||
Height=40
|
||||
Offset=-20,-20
|
||||
Picture=0,0,40,40
|
||||
Rotate=1
|
||||
NoStabilize=1
|
|
@ -0,0 +1 @@
|
|||
Checkpoint fur das spielziel Wettlauf.
|
|
@ -0,0 +1 @@
|
|||
Checkpoint for the race goal.
|
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 389 B |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 351 B |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 934 B |
|
@ -0,0 +1,236 @@
|
|||
/*-- CheckPoint --*/
|
||||
/*
|
||||
A checkpoint can have different modes, indicated with a bitmask:
|
||||
*None - Not a Checkpoint.
|
||||
*Start - Start of the race.
|
||||
*Finish - End of the race.
|
||||
*Respawn - The clonk can respawn at this CP.
|
||||
*Check - This checkpoint must be reached in order to complete the goal.
|
||||
*Ordered - These checkpoints must be reached in the right order.
|
||||
*/
|
||||
|
||||
/*-- Checkpoint modes --*/
|
||||
local CP_Mode;
|
||||
static const RACE_CP_None = 0;
|
||||
static const RACE_CP_Start = 1;
|
||||
static const RACE_CP_Finish = 2;
|
||||
static const RACE_CP_Respawn = 4;
|
||||
static const RACE_CP_Check = 8;
|
||||
static const RACE_CP_Ordered = 16;
|
||||
|
||||
public func SetCPMode(int iMode)
|
||||
{
|
||||
if (iMode & RACE_CP_Start) // Start always occurs alone.
|
||||
iMode = RACE_CP_Start;
|
||||
if (iMode & RACE_CP_Finish) // Start always occurs alone.
|
||||
iMode = RACE_CP_Finish;
|
||||
if (iMode & RACE_CP_Ordered) // Ordered checkpoints must have RACE_CP_Check.
|
||||
{
|
||||
iMode | RACE_CP_Check;
|
||||
// Set CP number.
|
||||
SetCPNumber(ObjectCount(Find_ID(GetID()), Find_Func("GetCPNumber")) + 1);
|
||||
}
|
||||
CP_Mode = iMode;
|
||||
UpdateGraphics();
|
||||
return;
|
||||
}
|
||||
|
||||
public func GetCPMode() { return CP_Mode; }
|
||||
|
||||
/*-- Checkpoint controller --*/
|
||||
local CP_Con;
|
||||
|
||||
public func SetCPController(object pCon)
|
||||
{
|
||||
CP_Con = pCon;
|
||||
return;
|
||||
}
|
||||
|
||||
/*-- Checkpoint number --*/
|
||||
local CP_Num;
|
||||
|
||||
public func SetCPNumber(int iNum)
|
||||
{
|
||||
CP_Num = iNum;
|
||||
return;
|
||||
}
|
||||
|
||||
public func GetCPNumber() { return CP_Num; }
|
||||
|
||||
/*-- Initialize --*/
|
||||
|
||||
local aDoneByPlr; // Array to keep track of players which were already here.
|
||||
local aDoneByTeam; // Array to keep track of teams which were already here.
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
aDoneByPlr = [];
|
||||
aDoneByTeam = [];
|
||||
CP_Mode = RACE_CP_Check;
|
||||
UpdateGraphics();
|
||||
AddEffect("IntCheckpoint", this, 100, 1, this);
|
||||
return;
|
||||
}
|
||||
|
||||
/*-- Checkpoint status --*/
|
||||
|
||||
public func ClearedByPlr(int iPlr)
|
||||
{
|
||||
return aDoneByPlr[iPlr];
|
||||
}
|
||||
|
||||
public func ClearedByTeam(int iTeam)
|
||||
{
|
||||
return aDoneByTeam[iTeam];
|
||||
}
|
||||
|
||||
public func IsActiveForPlr(int iPlr)
|
||||
{
|
||||
if (CP_Mode & RACE_CP_Finish) // Check all checkpoints.
|
||||
{
|
||||
for (var cp in FindObjects(Find_ID(GetID())))
|
||||
if (cp->GetCPMode() & RACE_CP_Check)
|
||||
if (!cp->ClearedByPlr(iPlr))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
if (CP_Mode & RACE_CP_Ordered)
|
||||
{
|
||||
if (GetCPNumber() == 1) // First ordered checkpoint is always active.
|
||||
return true;
|
||||
for (var cp in FindObjects(Find_ID(GetID()), Find_Func("GetCPNumber")))
|
||||
if (cp->GetCPNumber() + 1 == GetCPNumber())
|
||||
if (cp->ClearedByPlr(iPlr))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public func IsActiveForTeam(int iTeam)
|
||||
{
|
||||
if (!iTeam)
|
||||
return false;
|
||||
for (var i = 0; i < GetPlayerCount(); i++)
|
||||
if (GetPlayerTeam(GetPlayerByIndex(i)) == iTeam)
|
||||
if (IsActiveForPlr(GetPlayerByIndex(i)))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-- Checkpoint activity --*/
|
||||
|
||||
protected func FxIntCheckpointTimer()
|
||||
{
|
||||
CheckForClonks();
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
protected func CheckForClonks()
|
||||
{
|
||||
// Loop through all clonks inside the checkpoint.
|
||||
for (var pClonk in FindObjects(Find_OCF(OCF_CrewMember), Find_Distance(30)))
|
||||
{
|
||||
var iPlr = pClonk->GetOwner();
|
||||
var iTeam = GetPlayerTeam(iPlr);
|
||||
// Check whether this CP is already activated for iPlr or its team.
|
||||
if (!IsActiveForPlr(iPlr))
|
||||
if (!IsActiveForTeam(iTeam))
|
||||
continue;
|
||||
// Check respawn status.
|
||||
if (CP_Mode & RACE_CP_Respawn)
|
||||
if (CP_Con)
|
||||
CP_Con->SetPlrRespawnCP(iPlr, this); // Notify race goal.
|
||||
// If already done by player -> continue.
|
||||
if (aDoneByPlr[iPlr])
|
||||
continue;
|
||||
// Check checkpoint status.
|
||||
if (CP_Mode & RACE_CP_Check)
|
||||
{
|
||||
aDoneByPlr[iPlr] = true;
|
||||
if (!iTeam)
|
||||
if (CP_Con)
|
||||
CP_Con->AddPlrClearedCP(iPlr); // Notify race goal.
|
||||
if (iTeam && !aDoneByTeam[iTeam])
|
||||
{
|
||||
aDoneByTeam[iTeam] = true;
|
||||
if (CP_Con)
|
||||
CP_Con->AddPlrClearedCP(iPlr); // Notify race goal.
|
||||
}
|
||||
UpdateColor();
|
||||
}
|
||||
// Check finish status.
|
||||
if (CP_Mode & RACE_CP_Finish)
|
||||
{
|
||||
aDoneByPlr[iPlr] = true;
|
||||
if (CP_Con)
|
||||
CP_Con->PlayerHasReachedFinish(iPlr); // Notify race goal.
|
||||
UpdateColor();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*-- Checkpoint appearance --*/
|
||||
|
||||
// Mode-graphics.
|
||||
protected func UpdateGraphics()
|
||||
{
|
||||
// Clear all overlays first.
|
||||
for (var i = 1; i <= 4; i++)
|
||||
SetGraphics(0, 0, i);
|
||||
// Start.
|
||||
if (CP_Mode & RACE_CP_Start)
|
||||
SetGraphics("Start", GetID(), 1, GFXOV_MODE_Base);
|
||||
// Finish.
|
||||
if (CP_Mode & RACE_CP_Finish)
|
||||
SetGraphics("Finish", GetID(), 1, GFXOV_MODE_Base);
|
||||
// Respawn.
|
||||
if (CP_Mode & RACE_CP_Respawn)
|
||||
{
|
||||
SetGraphics("Respawn", GetID(), 2, GFXOV_MODE_Base);
|
||||
SetObjDrawTransform(1000, 0, -6000, 0, 1000, -3000, 2);
|
||||
}
|
||||
// Check.
|
||||
if (CP_Mode & RACE_CP_Check)
|
||||
{
|
||||
SetGraphics("Check", GetID(), 3, GFXOV_MODE_Base);
|
||||
SetObjDrawTransform(1000, 0, 6000, 0, 1000, -3000, 3);
|
||||
}
|
||||
// Ordered.
|
||||
if (CP_Mode & RACE_CP_Ordered)
|
||||
{
|
||||
SetGraphics(Format("%d", GetCPNumber()), NUMB, 4, GFXOV_MODE_Base);
|
||||
SetObjDrawTransform(200, 0, 0, 0, 200, 9000, 4);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Player cleared-graphics.
|
||||
protected func UpdateColor()
|
||||
{
|
||||
// Calculate nr of players that reached this CP.
|
||||
var plrcnt = 0;
|
||||
for (var i = 0; i < GetLength(aDoneByPlr); i++)
|
||||
if (aDoneByPlr[i])
|
||||
plrcnt++;
|
||||
// Ring color, for players that cleared this CP.
|
||||
var ringsec = 0;
|
||||
for (var i = 0; i < GetLength(aDoneByPlr); i++)
|
||||
{
|
||||
if (aDoneByPlr[i])
|
||||
{
|
||||
SetGraphics("Ring8", GetID(), 5 + i, GFXOV_MODE_Base);
|
||||
SetClrModulation(GetPlrColor(i), 5 + i);
|
||||
var angle = ringsec * 45;
|
||||
var s = Sin(angle, 1000), c = Cos(angle, 1000);
|
||||
SetObjDrawTransform(c, s, 0, -s, c, 0, 5 + i);
|
||||
ringsec++;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
func Definition(def) {
|
||||
SetProperty("Name", "$Name$", def);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
NameRace=Wettrennen
|
||||
|
||||
#Einzel
|
||||
MsgWinner=%s gebührt der Sieg!
|
||||
MsgYouWon=Du hast gewonnen!
|
||||
MsgOtherWon=%s hat das Rennen gewonnen.
|
||||
MsgTie=Unentschieden...
|
||||
MsgYouAhead=Du liegst mit %d% vorn!
|
||||
MsgOtherAhead=%s (%s) liegt vorne, und hat %d% des Weges geschafft. Du selbst hängst mit %d% hinterher.
|
||||
|
||||
#Team
|
||||
MsgTeamWinner=Team %s (%s) gebührt der Sieg!
|
||||
MsgYourTeamWon=Dein Team hat gewonnen.
|
||||
MsgOtherTeamWon=Team %s hat das Rennen gewonnen.
|
||||
MsgYourTeamAhead=Dein Team liegt mit %d% vorn!
|
||||
MsgOtherTeamAhead=Team %s liegt vorne, und hat %d% des Weges geschafft. Dein Team hängt mit %d% hinterher.
|
|
@ -0,0 +1 @@
|
|||
Name=Checkpoint
|
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 12 KiB |
|
@ -0,0 +1,9 @@
|
|||
[DefCore]
|
||||
id=PARK
|
||||
Version=4,9,8
|
||||
Category=C4D_StaticBack|C4D_Goal
|
||||
MaxUserSelect=1
|
||||
Width=1
|
||||
Height=1
|
||||
Value=100
|
||||
Picture=0,0,64,64
|
|
@ -0,0 +1 @@
|
|||
Der Spieler, der als erstes das Ziel erreicht, gewinnt.
|
|
@ -0,0 +1 @@
|
|||
The first player who reaches the goal wins.
|
After Width: | Height: | Size: 9.9 KiB |
|
@ -0,0 +1,8 @@
|
|||
[DefCore]
|
||||
id=RSTR
|
||||
Version=4,9,8
|
||||
Category=C4D_StaticBack|C4D_Rule
|
||||
MaxUserSelect=1
|
||||
Width=1
|
||||
Height=1
|
||||
Picture=0,0,64,64
|
|
@ -0,0 +1 @@
|
|||
Diese Spielregel erlaubt dem Spieler nochmal von vorne zu beginnen.
|
|
@ -0,0 +1 @@
|
|||
This rule allows the player to start again.
|
After Width: | Height: | Size: 8.1 KiB |
|
@ -0,0 +1,14 @@
|
|||
/*-- Neustart --*/
|
||||
|
||||
func Activate(iPlr)
|
||||
{
|
||||
// Szenario benachrichtigen
|
||||
if(GameCall("OnRestart", iPlr)) return;
|
||||
// Den Clonk des Spielers löschen
|
||||
var pClonk = GetCrew(iPlr);
|
||||
if (pClonk) pClonk->RemoveObject(true);
|
||||
}
|
||||
|
||||
func Definition(def) {
|
||||
SetProperty("Name", "$Name$", def);
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
Name=Neu starten
|
|
@ -0,0 +1 @@
|
|||
Name=Restart
|
|
@ -0,0 +1,250 @@
|
|||
/*-- Race --*/
|
||||
|
||||
/*
|
||||
The goal is to be the first to reach the finish, the team or player to do so wins the round.
|
||||
Checkpoints can be added to make the path more interesting and complex.
|
||||
Checkpoints can have different functionalities:
|
||||
* Respawn: On/Off - The clonk respawns at the last passed checkpoint.
|
||||
* Check: On/Off - The clonk must pass through these checkpoints before being able to finish.
|
||||
* Ordered: The checkpoints mussed be passed in the order specified.
|
||||
* The start and finish are also checkpoints.
|
||||
ToDo: Scoreboard, Teams, Color update CP.
|
||||
*/
|
||||
|
||||
#include GOAL
|
||||
|
||||
local fFinished; // Whether the goal has been reached by some player.
|
||||
local aCheckpoints; // List of checkpoints.
|
||||
local nrCheckpoints; // Nr. of checkpoints.
|
||||
local aRespawnCP; // List of last reached respawn CP per player.
|
||||
local aPlrCP; // Number of checkpoints the player completed.
|
||||
local aTeamCP; // Number of checkpoints the team completed.
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
fFinished = false;
|
||||
aCheckpoints = [];
|
||||
nrCheckpoints = 0;
|
||||
aRespawnCP = [];
|
||||
aPlrCP = [];
|
||||
aTeamCP = [];
|
||||
return _inherited(...);
|
||||
}
|
||||
|
||||
/*-- Checkpoint creation --*/
|
||||
|
||||
public func SetStartpoint(int iX, int iY)
|
||||
{
|
||||
var cp = CreateObject(CKPT, iX, iY, NO_OWNER);
|
||||
cp->SetPosition(iX, iY);
|
||||
cp->SetCPMode(RACE_CP_Start);
|
||||
cp->SetCPController(this);
|
||||
aCheckpoints[0] = cp;
|
||||
return;
|
||||
}
|
||||
|
||||
public func SetFinishpoint(int iX, int iY)
|
||||
{
|
||||
var cp = CreateObject(CKPT, iX, iY, NO_OWNER);
|
||||
cp->SetPosition(iX, iY);
|
||||
cp->SetCPMode(RACE_CP_Finish);
|
||||
cp->SetCPController(this);
|
||||
aCheckpoints[nrCheckpoints + 1] = cp;
|
||||
return;
|
||||
}
|
||||
|
||||
public func AddCheckpoint(int iX, int iY, int iMode)
|
||||
{
|
||||
var cp = CreateObject(CKPT, iX, iY, NO_OWNER);
|
||||
cp->SetPosition(iX, iY);
|
||||
cp->SetCPMode(iMode);
|
||||
cp->SetCPController(this);
|
||||
if (iMode & RACE_CP_Check || iMode & RACE_CP_Ordered)
|
||||
{
|
||||
nrCheckpoints++;
|
||||
aCheckpoints[nrCheckpoints + 1] = aCheckpoints[nrCheckpoints]; // Finish 1 place further.
|
||||
aCheckpoints[nrCheckpoints] = cp;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*-- Checkpoint interaction --*/
|
||||
|
||||
// Called from a finish CP to indicate that iPlr has reached it.
|
||||
public func PlayerHasReachedFinish(int iPlr)
|
||||
{
|
||||
aPlrCP[iPlr]++;
|
||||
if (GetPlayerTeam(iPlr))
|
||||
aTeamCP[GetPlayerTeam(iPlr)]++;
|
||||
UpdateScoreboard(iPlr);
|
||||
EliminatePlayers(iPlr);
|
||||
fFinished = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Called from a respawn CP to indicate that iPlr has reached it.
|
||||
public func SetPlrRespawnCP(int iPlr, object pCP)
|
||||
{
|
||||
aRespawnCP[iPlr] = pCP;
|
||||
return;
|
||||
}
|
||||
|
||||
// Called from a check CP to indicate that iPlr has reached it.
|
||||
public func AddPlrClearedCP(int iPlr)
|
||||
{
|
||||
aPlrCP[iPlr]++;
|
||||
if (GetPlayerTeam(iPlr))
|
||||
aTeamCP[GetPlayerTeam(iPlr)]++;
|
||||
UpdateScoreboard(iPlr);
|
||||
return;
|
||||
}
|
||||
|
||||
/*-- Goal checking --*/
|
||||
|
||||
// Eliminate all players apart from iWinner and his team.
|
||||
private func EliminatePlayers(int iWinner)
|
||||
{
|
||||
var iWinTeam = GetPlayerTeam(iWinner);
|
||||
for (var i = 0; i < GetPlayerCount(); i++)
|
||||
{
|
||||
var iPlr = GetPlayerByIndex(i);
|
||||
var iTeam = GetPlayerTeam(iPlr);
|
||||
if (iPlr == iWinner) // The winner self.
|
||||
continue;
|
||||
if (iTeam && iTeam == iWinTeam) // In the same team as the winner.
|
||||
continue;
|
||||
EliminatePlayer(iPlr);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
public func IsFulfilled()
|
||||
{
|
||||
return fFinished;
|
||||
}
|
||||
|
||||
public func Activate(int iPlr)
|
||||
{
|
||||
var iTeam = GetPlayerTeam(iPlr);
|
||||
var szMessage = "";
|
||||
if (fFinished)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
szMessage = Format(Translate("MsgRace"), nrCheckpoints + 1);
|
||||
}
|
||||
MessageWindow(szMessage, iPlr);
|
||||
return;
|
||||
}
|
||||
|
||||
private func GetPlrPos(int iPlr)
|
||||
{
|
||||
var cp;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*-- Player section --*/
|
||||
|
||||
protected func InitializePlayer(int iPlr, int iX, int iY, object pBase, int iTeam)
|
||||
{
|
||||
// If the race is already finished, then immediately eliminate player.
|
||||
if (fFinished)
|
||||
return EliminatePlayer(iPlr);
|
||||
// Remove all hostilities.
|
||||
for (var i = 0; i < GetPlayerCount(); i++)
|
||||
{
|
||||
SetHostility(iPlr, GetPlayerByIndex(i), 0, 1);
|
||||
SetHostility(GetPlayerByIndex(i), iPlr, 0, 1);
|
||||
}
|
||||
// Init Respawn CP to start CP.
|
||||
aRespawnCP[iPlr] = aCheckpoints[0];
|
||||
aPlrCP[iPlr] = 0;
|
||||
if (iTeam)
|
||||
if (!aPlrCP[iTeam])
|
||||
aPlrCP[iTeam] = 0;
|
||||
UpdateScoreboard(iPlr);
|
||||
DoScoreboardShow(1, iPlr + 1);
|
||||
JoinPlayer(iPlr);
|
||||
return;
|
||||
}
|
||||
|
||||
protected func RelaunchPlayer(int iPlr)
|
||||
{
|
||||
var clonk = CreateObject(CLNK, 0, 0, iPlr);
|
||||
clonk->MakeCrewMember(iPlr);
|
||||
SetCursor(iPlr,clonk);
|
||||
SelectCrew(iPlr, clonk, true);
|
||||
Log(RndRelaunchMsg(), GetPlayerName(iPlr));
|
||||
JoinPlayer(iPlr);
|
||||
return;
|
||||
}
|
||||
|
||||
private func RndRelaunchMsg()
|
||||
{
|
||||
return Translate(Format("MsgRelaunch%d", Random(4)));
|
||||
}
|
||||
|
||||
protected func JoinPlayer(int iPlr)
|
||||
{
|
||||
var clonk = GetCrew(iPlr);
|
||||
clonk->DoEnergy(100000);
|
||||
var x, y;
|
||||
FindRespawnPos(iPlr, x, y);
|
||||
clonk->SetPosition(x, y);
|
||||
// Give scenario defined objects.
|
||||
if (GameCall("RACE_GiveContents"))
|
||||
for(var idObj in GameCall("RACE_GiveContents"))
|
||||
clonk->CreateContents(idObj);
|
||||
return;
|
||||
}
|
||||
|
||||
private func FindRespawnPos(int iPlr, int &iX, int &iY)
|
||||
{
|
||||
iX = aRespawnCP[iPlr]->GetX();
|
||||
iY = aRespawnCP[iPlr]->GetY();
|
||||
return;
|
||||
}
|
||||
|
||||
protected func RemovePlayer(int iPlr)
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*-- Scoreboard --*/
|
||||
|
||||
static const SBRD_Checkpoints = 0;
|
||||
static const SBRD_Distance = 1;
|
||||
|
||||
private func UpdateScoreboard(int iPlr)
|
||||
{
|
||||
//if (GetPlayerTeam(iPlr))
|
||||
var szCaption = Format("Race over %d checkpoints", nrCheckpoints + 1);
|
||||
SetScoreboardData(SBRD_Caption, SBRD_Caption, szCaption, SBRD_Caption);
|
||||
SetScoreboardData(SBRD_Caption, SBRD_Checkpoints, Format("{{%i}}", CKPT), SBRD_Caption);
|
||||
//SetScoreboardData(SBRD_Caption, SBRD_Distance, "D", SBRD_Caption);
|
||||
SetScoreboardData(iPlr, SBRD_Caption, GetTaggedPlayerName(iPlr), SBRD_Caption);
|
||||
SetScoreboardData(iPlr, SBRD_Checkpoints, Format("%d", aPlrCP[iPlr]), aPlrCP[iPlr]);
|
||||
return;
|
||||
}
|
||||
|
||||
// Returns the number of players in a team
|
||||
private func GetTeamPlrCount(int iTeam)
|
||||
{
|
||||
var cnt = 0;
|
||||
for(var i = 0; i < GetPlayerCount(); i++)
|
||||
if(GetPlayerTeam(GetPlayerByIndex(i)) == iTeam)
|
||||
cnt++;
|
||||
return cnt;
|
||||
}
|
||||
|
||||
|
||||
func Definition(def) {
|
||||
SetProperty("Name", "$Name$", def);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
NameRace=Wettrennen
|
||||
|
||||
#Einzel
|
||||
MsgWinner=%s gebührt der Sieg!
|
||||
MsgYouWon=Du hast gewonnen!
|
||||
MsgOtherWon=%s hat das Rennen gewonnen.
|
||||
MsgTie=Unentschieden...
|
||||
MsgYouAhead=Du liegst mit %d% vorn!
|
||||
MsgOtherAhead=%s (%s) liegt vorne, und hat %d% des Weges geschafft. Du selbst hängst mit %d% hinterher.
|
||||
|
||||
#Team
|
||||
MsgTeamWinner=Team %s (%s) gebührt der Sieg!
|
||||
MsgYourTeamWon=Dein Team hat gewonnen.
|
||||
MsgOtherTeamWon=Team %s hat das Rennen gewonnen.
|
||||
MsgYourTeamAhead=Dein Team liegt mit %d% vorn!
|
||||
MsgOtherTeamAhead=Team %s liegt vorne, und hat %d% des Weges geschafft. Dein Team hängt mit %d% hinterher.
|
|
@ -0,0 +1,24 @@
|
|||
Name=Race
|
||||
|
||||
#Single
|
||||
MsgWinner=%s wins the race!
|
||||
MsgYouWon=You have won the race!
|
||||
MsgOtherWon=%s has won the race!
|
||||
MsgTie=It's a tie!
|
||||
MsgYouAhead=You're ahead at %d%!
|
||||
MsgOtherAhead=%s (%s) is ahead at %d% of the way. You're behind at %d%.
|
||||
|
||||
#Team
|
||||
MsgTeamWinner=Team %s (%s) wins the race!
|
||||
MsgYourTeamWon=Your team has won the race!
|
||||
MsgOtherTeamWon=Team %s has won the race!
|
||||
MsgYourTeamAhead=Your team is ahead at %d%!
|
||||
MsgOtherTeamAhead=Team %s is ahead at %d% of the way. Your team is behind at %d%.
|
||||
|
||||
MsgRace=This is race over %d checkpoints, check the scoreboard for the nr of completed checkpoints per team/player.
|
||||
|
||||
#Relaunch
|
||||
MsgRelaunch0=%s tries it again.
|
||||
MsgRelaunch1=%s is dead.
|
||||
MsgRelaunch2=Haha, %s!
|
||||
MsgRelaunch3=We're mourning %s.
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
|
@ -0,0 +1,56 @@
|
|||
/*-- The Summit --*/
|
||||
|
||||
overlay Mats {
|
||||
algo=rndchecker;
|
||||
a=8;
|
||||
zoomX=-50; zoomY=-50;
|
||||
turbulence=500; loosebounds=1;
|
||||
};
|
||||
|
||||
overlay MatFill {
|
||||
overlay { mat=Earth; tex=earth_dry; loosebounds=1; };
|
||||
Mats { mat=Lava; tex=lava_red; a=20; };
|
||||
Mats { mat=Ore; tex=ore; };
|
||||
Mats { mat=Gold; tex=gold; };
|
||||
Mats { mat=Rock; tex=rock; };
|
||||
Mats { mat=Tunnel; tex=tunnel; };
|
||||
Mats { mat=Earth; tex=earth_dry; };
|
||||
Mats { mat=Earth; tex=earth_rough; };
|
||||
overlay {
|
||||
algo=lines;
|
||||
a=3; b=16;
|
||||
rotate=45;
|
||||
turbulence=500;
|
||||
mat=Tunnel; tex=tunnel;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
overlay RockFill {
|
||||
overlay { mat=Rock; tex=rock; loosebounds=1;
|
||||
overlay { mat=Rock; tex=rock_cracked; algo=bozo; a=6; turbulence=5000; loosebounds=1; };
|
||||
overlay { mat=Granite; tex=granite; algo=bozo; a=14; turbulence=5000; loosebounds=1; };
|
||||
overlay { mat=Tunnel; tex=tunnel; algo=bozo; a=5; turbulence=5000; loosebounds=1; };
|
||||
overlay { mat=Tunnel; tex=tunnel; algo=bozo; a=5; turbulence=5000; loosebounds=1; };
|
||||
};
|
||||
};
|
||||
|
||||
map Summit {
|
||||
// Basic shape.
|
||||
overlay {
|
||||
y=95; hgt=20;
|
||||
mask=1;
|
||||
} |
|
||||
overlay {
|
||||
algo=lines;
|
||||
a=100; b=120;
|
||||
ox=-50;
|
||||
turbulence=500; lambda=3;
|
||||
mask=1;
|
||||
MatFill;
|
||||
overlay {
|
||||
algo = border; a=4; b=4;
|
||||
RockFill;
|
||||
};
|
||||
};
|
||||
};
|
|
@ -0,0 +1,48 @@
|
|||
[Head]
|
||||
Icon=26
|
||||
Title=TheSummit
|
||||
Version=4,10,0,0
|
||||
MaxPlayer=8
|
||||
|
||||
[Definitions]
|
||||
Definition1=Objects.c4d
|
||||
|
||||
[Game]
|
||||
Rules=RSTR=1
|
||||
|
||||
[Player1]
|
||||
Wealth=50,0,0,250
|
||||
Crew=CLNK=1
|
||||
|
||||
[Player2]
|
||||
Wealth=50,0,0,250
|
||||
Crew=CLNK=1
|
||||
|
||||
[Player3]
|
||||
Wealth=50,0,0,250
|
||||
Crew=CLNK=1
|
||||
|
||||
[Player4]
|
||||
Wealth=50,0,0,250
|
||||
Crew=CLNK=1
|
||||
|
||||
[Landscape]
|
||||
Vegetation=TRE1=1;TRE2=2;TRE3=1;TRE4=1
|
||||
VegetationLevel=100,0,0,100
|
||||
InEarth=ROCK=1;GOLD=1;DYNA=3;LOAM=3
|
||||
InEarthLevel=80,0,0,100
|
||||
Sky=Clouds2
|
||||
BottomOpen=1
|
||||
MapWidth=100,0,64,10000
|
||||
MapHeight=250,0,40,10000
|
||||
SkyScrollMode=2
|
||||
NewStyleLandscape=2
|
||||
|
||||
[Weather]
|
||||
Climate=0,0,0,100
|
||||
YearSpeed=20,10,0,100
|
||||
Wind=1,100,-100,100
|
||||
|
||||
[Animals]
|
||||
Nest=LOAM=50;DYNA=40
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
/*-- The Summit --*/
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
// Create the race goal.
|
||||
var pGoal = CreateObject(PARK, 0, 0, NO_OWNER);
|
||||
// Set start point.
|
||||
var x, y;
|
||||
var d = 100;
|
||||
while(!FindPosInMat(x, y, "Sky", 0, LandscapeHeight()-d-40, LandscapeWidth(), 40, 20) && d < LandscapeHeight())
|
||||
d += 10;
|
||||
pGoal->SetStartpoint(x, y);
|
||||
// Set some checkpoints.
|
||||
for (var i = 0; d < LandscapeHeight()-400; i++)
|
||||
{
|
||||
var mode = RACE_CP_Check;
|
||||
d += RandomX(150,300);
|
||||
if (!FindPosInMat(x, y, "Tunnel", 0, LandscapeHeight()-d-80, LandscapeWidth(), 80, 20))
|
||||
FindPosInMat(x, y, "Sky", 0, LandscapeHeight()-d-80, LandscapeWidth(), 80, 20);
|
||||
else
|
||||
mode = mode | RACE_CP_Respawn;
|
||||
// All checkpoints ordered.
|
||||
mode = mode | RACE_CP_Ordered;
|
||||
pGoal->AddCheckpoint(x, y, mode);
|
||||
}
|
||||
// Set finish point.
|
||||
d = 0;
|
||||
while(!FindPosInMat(x, y, "Sky", 0, 20+d, LandscapeWidth(), 40, 20) && d < LandscapeHeight())
|
||||
d += 10;
|
||||
pGoal->SetFinishpoint(x, y);
|
||||
// Done.
|
||||
return;
|
||||
}
|
||||
|
||||
protected func FindPosInMat(int &iToX, int &iToY, string sMat, int iXStart, int iYStart, int iWidth, int iHeight, int iSize)
|
||||
{
|
||||
var iX, iY;
|
||||
for (var i = 0; i < 500; i++)
|
||||
{
|
||||
iX = iXStart+Random(iWidth);
|
||||
iY = iYStart+Random(iHeight);
|
||||
if(GetMaterial(AbsX(iX),AbsY(iY))==Material(sMat) &&
|
||||
GetMaterial(AbsX(iX+iSize),AbsY(iY+iSize))==Material(sMat) &&
|
||||
GetMaterial(AbsX(iX+iSize),AbsY(iY-iSize))==Material(sMat) &&
|
||||
GetMaterial(AbsX(iX-iSize),AbsY(iY-iSize))==Material(sMat) &&
|
||||
GetMaterial(AbsX(iX-iSize),AbsY(iY+iSize))==Material(sMat))
|
||||
{
|
||||
iToX = iX; iToY = iY;
|
||||
return true; // Location found.
|
||||
}
|
||||
}
|
||||
return false; // No location found.
|
||||
}
|
||||
|
||||
protected func RACE_GiveContents()
|
||||
{
|
||||
return [LOAM,MJOW];
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
DE:Die Höhle
|
||||
US:The Cavern
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
@ -12,7 +12,6 @@ ForcedGfxMode=1
|
|||
Definition1=Objects.c4d
|
||||
|
||||
[Game]
|
||||
Goals=RACE=1
|
||||
Rules=RSTR=1
|
||||
|
||||
[Player1]
|
|
@ -0,0 +1,20 @@
|
|||
/* Sky race */
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
for (var i=0; i<20; ++i) CreateObject(LOAM, 1560+Random(11)-5, 200+Random(11)-5, NO_OWNER);
|
||||
for (var i=0; i<20; ++i) CreateObject(DYNA, 2730+Random(11)-5, 660+Random(11)-5, NO_OWNER);
|
||||
// Create the race goal.
|
||||
var pGoal = CreateObject(PARK, 0, 0, NO_OWNER);
|
||||
pGoal->SetStartpoint(50, 475);
|
||||
pGoal->AddCheckpoint(930, 510, RACE_CP_Respawn);
|
||||
pGoal->AddCheckpoint(1700, 300, RACE_CP_Respawn);
|
||||
pGoal->AddCheckpoint(2730, 730, RACE_CP_Respawn);
|
||||
pGoal->SetFinishpoint(4950, 475);
|
||||
}
|
||||
|
||||
protected func RACE_GiveContents()
|
||||
{
|
||||
return [BOW1,ARRW];
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
/* Sky race */
|
||||
|
||||
func Initialize()
|
||||
{
|
||||
for (var i=0; i<20; ++i) CreateObject(LOAM, 1560+Random(11)-5, 200+Random(11)-5, NO_OWNER);
|
||||
for (var i=0; i<20; ++i) CreateObject(DYNA, 2730+Random(11)-5, 660+Random(11)-5, NO_OWNER);
|
||||
}
|
||||
|
||||
func InitializePlayer(int plr)
|
||||
{
|
||||
return JoinPlayer(plr);
|
||||
}
|
||||
|
||||
private func JoinPlayer(int plr)
|
||||
{
|
||||
var obj=GetCrew(plr);
|
||||
obj->DoEnergy(100000);
|
||||
obj->SetPosition(10+Random(50), LandscapeHeight()/2-30);
|
||||
obj->CreateContents(BOW1);
|
||||
obj->CreateContents(ARRW);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Relaunch */
|
||||
|
||||
public func RelaunchPlayer(int plr)
|
||||
{
|
||||
var clnk=CreateObject(CLNK,0,0,plr);
|
||||
clnk->MakeCrewMember(plr);
|
||||
SetCursor(plr,clnk);
|
||||
SelectCrew(plr, clnk, 1);
|
||||
Log(RndRelaunchMsg(), GetPlayerName(plr));
|
||||
return JoinPlayer(plr);
|
||||
}
|
||||
|
||||
private func RndRelaunchMsg()
|
||||
{
|
||||
return Translate(Format("RelaunchMsg%d", Random(4)));
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
RelaunchMsg0=%s versucht es nochmal.
|
||||
RelaunchMsg1=%s ist tot.
|
||||
RelaunchMsg2=Eine Runde Gelaechter fuer %s.
|
||||
RelaunchMsg3=Wir trauern um %s.
|
|
@ -1,4 +0,0 @@
|
|||
RelaunchMsg0=%s tries it again.
|
||||
RelaunchMsg1=%s is dead.
|
||||
RelaunchMsg2=Haha, %s!
|
||||
RelaunchMsg3=We're mourning %s.
|