HotIce: Balloon spawn added for extra fairness.

qteditor^2
Clonkonaut 2016-08-08 18:25:15 +02:00
parent 700d5c199f
commit e5d90c90c6
5 changed files with 75 additions and 15 deletions

View File

@ -77,6 +77,9 @@ func DrawSmallIslandsMap(proplist map)
if (Abs(x-w/2) < w/10) szx += Random(3); // central islands sometimes wider
map->Draw("^Ice-ice2", nil, [x-szx,y,1+2*szx,szy]);
}
// Balloon spawn: do nothing further
if (SCENPAR_SpawnType == 1)
return true;
// Starting islands for player spawns
var spawn_island_count = Max(GetStartupPlayerCount(), 2);
g_player_spawn_positions = CreateArray(spawn_island_count);

View File

@ -34,6 +34,24 @@ Default=1
Description=$DescWeaponsExplosive$
Value=1
[ParameterDef]
Name=$SpawnType$
Description=$DescSpawn$
ID=SpawnType
Default=1
[Options]
[Option]
Name=$ClassicSpawn$
Description=$DescClassicSpawn$
Value=0
[Option]
Name=$BalloonSpawn$
Description=$DescBalloonSpawn$
Value=1
[ParameterDef]
Name=$Rounds$
Description=$DescRounds$

View File

@ -60,7 +60,8 @@ func InitializeRound()
// Checking for victory: Only active after a Clonk dies.
g_check_victory_effect = AddEffect("CheckVictory", nil, 1, 0);
g_player_spawn_index = 0;
ShuffleArray(g_player_spawn_positions);
if (GetType(g_player_spawn_positions) == C4V_Array)
ShuffleArray(g_player_spawn_positions);
// Materials: Chests
var i,pos;
@ -136,20 +137,34 @@ func InitPlayerRound(int plr)
var ls_wdt = LandscapeWidth(), ls_hgt = LandscapeHeight();
var crew = GetCrew(plr), start_pos;
// Position by map type?
if (g_player_spawn_positions && g_player_spawn_index < GetLength(g_player_spawn_positions))
if (SCENPAR_SpawnType == 0)
{
start_pos = g_player_spawn_positions[g_player_spawn_index++];
var map_zoom = ls_wdt / g_map_width;
start_pos = {x=start_pos[0]*map_zoom+map_zoom/2, y=start_pos[1]*map_zoom};
if (g_player_spawn_positions && g_player_spawn_index < GetLength(g_player_spawn_positions))
{
start_pos = g_player_spawn_positions[g_player_spawn_index++];
var map_zoom = ls_wdt / g_map_width;
start_pos = {x=start_pos[0]*map_zoom+map_zoom/2, y=start_pos[1]*map_zoom};
}
else
{
// Start positions not defined or exhausted: Spawn in lower area for both maps becuase starting high is an an advantage.
start_pos = FindLocation(Loc_InRect(ls_wdt/5,ls_hgt/2,ls_wdt*3/5,ls_hgt/3), Loc_Wall(CNAT_Bottom), Loc_Func(Scenario.IsStartSpot));
if (!start_pos) start_pos = FindLocation(Loc_InRect(ls_wdt/10,0,ls_wdt*8/10,ls_hgt*4/5), Loc_Wall(CNAT_Bottom), Loc_Func(Scenario.IsStartSpot));
if (!start_pos) start_pos = {x=Random(ls_wdt*6/10)+ls_wdt*2/10, y=ls_hgt*58/100};
}
crew->SetPosition(start_pos.x, start_pos.y-10);
}
else
else // Balloon spawn
{
// Start positions not defined or exhausted: Spawn in lower area for both maps becuase starting high is an an advantage.
start_pos = FindLocation(Loc_InRect(ls_wdt/5,ls_hgt/2,ls_wdt*3/5,ls_hgt/3), Loc_Wall(CNAT_Bottom), Loc_Func(Scenario.IsStartSpot));
if (!start_pos) start_pos = FindLocation(Loc_InRect(ls_wdt/10,0,ls_wdt*8/10,ls_hgt*4/5), Loc_Wall(CNAT_Bottom), Loc_Func(Scenario.IsStartSpot));
if (!start_pos) start_pos = {x=Random(ls_wdt*6/10)+ls_wdt*2/10, y=ls_hgt*58/100};
var spawn_x = ls_wdt/3, spawn_y = 10;
spawn_x += Random(spawn_x);
var balloon = CreateObject(BalloonDeployed, spawn_x, spawn_y - 16, plr);
crew->SetPosition(spawn_x, spawn_y);
balloon->SetRider(crew);
crew->SetAction("Ride", balloon);
balloon->SetSpeed(0,0);
crew->SetSpeed(0,0);
}
crew->SetPosition(start_pos.x, start_pos.y-10);
// initial material
if (SCENPAR_Weapons == 0)
{
@ -181,9 +196,19 @@ func InitPlayerRound(int plr)
// Disable the Clonk during the countdown.
crew->SetCrewEnabled(false);
crew->SetComDir(COMD_Stop);
if (SCENPAR_SpawnType == 1 && balloon)
balloon->CreateEffect(IntNoGravity, 1, 1);
return true;
}
local IntNoGravity = new Effect {
Timer = func() {
Target->SetSpeed(0,0);
}
};
// Called by the round start countdown.
func OnCountdownFinished()
{
@ -192,6 +217,8 @@ func OnCountdownFinished()
{
clonk->SetCrewEnabled(true);
SetCursor(clonk->GetOwner(), clonk);
if (SCENPAR_SpawnType == 1 && clonk->GetActionTarget())
RemoveEffect("IntNoGravity", clonk->GetActionTarget());
}
}

View File

@ -10,6 +10,12 @@ WeaponsClassic=Klassisch
DescWeaponsClassic=Bögen, Speere, Keulen und einige Feuersteine
WeaponsExplosive=Explosiv
DescWeaponsExplosive=Nur Granatwerfer mit Endlosmunition
SpawnType=Startpunkte
DescSpawn=Legt fest, wo die Clonks der Spieler starten.
ClassicSpawn=Klassisch
DescClassicSpawn=Die Clonks starten auf den Eisinseln.
BalloonSpawn=Ballons
DescBalloonSpawn=Die Clonks fallen mit Ballons vom Himmel.
Rounds=Rundenzahl
DescRounds=Mehrere Runden spielen
Stalemate=Unentschieden!

View File

@ -5,13 +5,19 @@ DescMapTypeBigIsland=One central main island with small spots of ice in the air
MapTypeSpots=Small islands
DescMapTypeSpots=Many small spots of ice in the air.
Weapons=Weapons
DescWeapons=Defines which weapons are available for players
DescWeapons=Defines which weapons are available for players.
WeaponsClassic=Classic
DescWeaponsClassic=Bows, spears and clubs available in chests
DescWeaponsClassic=Bows, spears and clubs available in chests.
WeaponsExplosive=Explosive
DescWeaponsExplosive=Only grenade lauchers and wind bags available
DescWeaponsExplosive=Only grenade lauchers and wind bags available.
SpawnType=Spawn points
DescSpawn=Defines where the starting positions will be.
ClassicSpawn=Classic
DescClassicSpawn=All clonks start on the ice islands.
BalloonSpawn=Balloons
DescBalloonSpawn=The clonks will drop with balloons from the sky.
Rounds=Number of rounds
DescRounds=Play for multiple rounds
DescRounds=Play for multiple rounds.
Stalemate=Stalemate!
WinningTeam=Winning team: %s
RemainingRounds=%d rounds remaining.