Skip to content

Commit 2ac806a

Browse files
committed
2 parents 9b9f827 + a0db9fb commit 2ac806a

4 files changed

Lines changed: 54 additions & 34 deletions

File tree

MissionEditor/MissionEditor2/MissionBase/LuaUI/Widgets/camera_beautyshot.lua

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ local defaults = {time = 0, maxCamOffset = 10, minHeading = 15, maxHeading = 165
1414
local MAX_TRIES = 50
1515
local tau = 2*math.pi
1616

17+
-- workaround bug where negative args throw an empty interval error
18+
-- fixes https://github.com/ZeroK-RTS/Zero-K/issues/2906
19+
local function randomCustom(min, max)
20+
if min == max then
21+
return 0
22+
end
23+
if min > max then
24+
min, max = max, min
25+
end
26+
local distFromZero = 0
27+
if min < 0 then
28+
distFromZero = -min
29+
end
30+
return math.random(min + distFromZero, max + distFromZero) - distFromZero
31+
end
32+
1733
local function BeautyShot(unitID, params)
1834
params = params or {}
1935
for i,v in pairs(defaults) do
@@ -29,14 +45,14 @@ local function BeautyShot(unitID, params)
2945
end
3046
if not (x and y and z) then
3147
if validUnit then
32-
_,_,_,x,y,z = Spring.GetUnitPosition(unitID, true)
33-
else
34-
Spring.Log(widget:GetInfo().name, LOG.ERROR, "No valid unit and no position, cannot make beauty shot")
48+
_,_,_,x,y,z = Spring.GetUnitPosition(unitID, true)
49+
else
50+
Spring.Log(widget:GetInfo().name, LOG.ERROR, "No valid unit and no position, cannot make beauty shot")
3551
return
3652
end
3753
end
3854
for i=1,MAX_TRIES do
39-
local camFromTargetHeading = math.random(params.minHeading, params.maxHeading)
55+
local camFromTargetHeading = randomCustom(params.minHeading, params.maxHeading)
4056
if math.random() > 0.5 then
4157
camFromTargetHeading = -camFromTargetHeading
4258
end
@@ -45,13 +61,13 @@ local function BeautyShot(unitID, params)
4561
local unitHeading = Spring.GetUnitHeading(unitID)*tau/65536
4662
camFromTargetHeading = camFromTargetHeading + unitHeading
4763
end
48-
local angleMod = math.random(-params.maxCamOffset, params.maxCamOffset)
64+
local angleMod = randomCustom(-params.maxCamOffset, params.maxCamOffset)
4965
angleMod = math.rad(angleMod)
50-
local dist2d = params.distance or math.random(params.minDistance,params.maxDistance)
66+
local dist2d = params.distance or randomCustom(params.minDistance,params.maxDistance)
5167
if validUnit then
5268
dist2d = dist2d + Spring.GetUnitRadius(unitID)
5369
end
54-
local camPitch = math.random(params.minPitch, params.maxPitch)
70+
local camPitch = randomCustom(params.minPitch, params.maxPitch)
5571
camPitch = math.rad(camPitch)
5672
local dy = dist2d*math.tan(camPitch)
5773
--local dist = (dist2d^2 + dy^2)^0.5

ZkLobbyServer/SpringieInterface/StartSetup.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Data.Entity;
44
using System.Diagnostics;
5+
using System.Globalization;
56
using System.Linq;
67
using System.Text;
78
using PlasmaShared;
@@ -86,14 +87,14 @@ public static LobbyHostingContext GetDedicatedServerStartSetup(LobbyHostingConte
8687
ret.ModOptions["planet"] = planet.Name;
8788
ret.ModOptions["pw_galaxyTurn"] = galaxy.Turn.ToString();
8889

89-
ret.ModOptions["pw_baseIP"] = GlobalConst.BaseInfluencePerBattle.ToString();
90-
ret.ModOptions["pw_dropshipIP"] = planet.GetEffectiveShipIpBonus(attacker).ToString();
91-
ret.ModOptions["pw_defenseIP"] = planet.GetEffectiveIpDefense().ToString();
92-
ret.ModOptions["pw_attackerIP"] = (planet.PlanetFactions.FirstOrDefault(x => x.FactionID == attacker.FactionID)?.Influence ?? 0).ToString();
93-
ret.ModOptions["pw_maxIP"] = GlobalConst.PlanetWarsMaximumIP.ToString();
94-
ret.ModOptions["pw_neededIP"] = GlobalConst.InfluenceToCapturePlanet.ToString();
95-
ret.ModOptions["pw_attackerWinLoseCC"] = GlobalConst.PlanetWarsAttackerWinLoseCcMultiplier.ToString();
96-
ret.ModOptions["pw_defenderWinKillCC"] = GlobalConst.PlanetWarsDefenderWinKillCcMultiplier.ToString();
90+
ret.ModOptions["pw_baseIP"] = GlobalConst.BaseInfluencePerBattle.ToString(CultureInfo.InvariantCulture);
91+
ret.ModOptions["pw_dropshipIP"] = planet.GetEffectiveShipIpBonus(attacker).ToString(CultureInfo.InvariantCulture);
92+
ret.ModOptions["pw_defenseIP"] = planet.GetEffectiveIpDefense().ToString(CultureInfo.InvariantCulture);
93+
ret.ModOptions["pw_attackerIP"] = (planet.PlanetFactions.FirstOrDefault(x => x.FactionID == attacker.FactionID)?.Influence ?? 0).ToString(CultureInfo.InvariantCulture);
94+
ret.ModOptions["pw_maxIP"] = GlobalConst.PlanetWarsMaximumIP.ToString(CultureInfo.InvariantCulture);
95+
ret.ModOptions["pw_neededIP"] = GlobalConst.InfluenceToCapturePlanet.ToString(CultureInfo.InvariantCulture);
96+
ret.ModOptions["pw_attackerWinLoseCC"] = GlobalConst.PlanetWarsAttackerWinLoseCcMultiplier.ToString(CultureInfo.InvariantCulture);
97+
ret.ModOptions["pw_defenderWinKillCC"] = GlobalConst.PlanetWarsDefenderWinKillCcMultiplier.ToString(CultureInfo.InvariantCulture);
9798
}
9899

99100
// write player custom keys (level, elo, is muted, etc.)

presskit/data.xml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

3-
<game>
3+
<game>
44
<title>Zero-K</title>
55
<founding-date>October 1, 2010</founding-date>
6+
<release-date>April 27, 2018</release-date>
67
<website>zero-k.info</website>
78
<based-in>International</based-in>
8-
9+
<press-can-request-copy>TRUE</press-can-request-copy>
910

1011
<platforms>
1112
<platform>
@@ -18,12 +19,11 @@
1819
</platform>
1920
</platforms>
2021

21-
2222
<press-contact>team@zero-k.info</press-contact>
23-
<phone>0</phone>
23+
<phone>No</phone>
2424
<address>
2525
<line>The Internet</line>
26-
</address>
26+
</address>
2727

2828
<socials>
2929
<social>
@@ -34,21 +34,21 @@
3434
<name>facebook.com/ZeroK.RTS</name>
3535
<link>facebook.com/ZeroK.RTS</link>
3636
</social>
37-
</socials>
37+
</socials>
3838

39-
<description>
40-
Zero-K is a traditional RTS focused on physics and creativity. Construct fortresses or tear down obstacles with free-form terrain manipulation. Launch jumpjet robots into the air with gravity guns and have them rain down on your opponents base. Combine over 100 units types from 12 distinct technology branches. Every unit in Zero-K is defined more by its unique combination of movement and weapon physics than it is by raw attributes, such as health and damage. Use quick nimble bots to dodge the slow projectiles of weapons better suited at hitting ponderous tanks. Conquer the galaxy in a singleplayer campaign spanning 71 missions or grab some friends to fend off waves of alien invaders. Join our online community for games ranging from 1v1 to 16v16 as well as free-for-all and regular tournaments.
39+
<description>
40+
Zero-K is a traditional real time strategy game with a focus on player creativity through terrain manipulation, physics, and a large roster of unique units - all while being balanced to support competitive play. Construct fortresses or tear down obstacles with free-form terrain manipulation. Launch jumpjet robots into the air with gravity guns and have them rain down on your opponents base. Combine over 100 units types from 12 distinct technology branches. Every unit in Zero-K is defined more by its unique combination of movement and weapon physics than it is by raw attributes, such as health and damage. Use quick nimble bots to dodge the slow projectiles of weapons better suited at hitting ponderous tanks. Conquer the galaxy in a singleplayer campaign spanning 71 missions or grab some friends to fend off waves of alien invaders. Join our online community for games ranging from 1v1 to 16v16 as well as free-for-all and regular tournaments.
4141
</description>
42-
42+
4343
<histories>
4444
<history>
4545
<text>Zero-K is managed and developed entirely by passionate volunteers. These volunteers are primarily drawn from its multiplayer community, which has existed for almost as long as the game itself. The bulk of the work is done by a handful of core developers with the occasional contribution of code or assets by members of the wider community. In Zero-K the concept of community generated content is hard to pin down as members of the community can become core developers through activity and competence. This resulted in a game which was constantly tested and optimized for multiplayer, but we wanted more. More players, specifically.
4646

4747
With such a focus on multiplayer Zero-K had become too daunting for many new players. The lead developers, Licho and GoogleFrog, shifted the focus of the project towards polish, singleplayer content and the new player experience. Enforcing this focus was a bit like herding (volunteer) cats as a developers default behaviour is to add cool new features. Despite this, progress was made, interfaces polished, campaigns designed. Luckily Zero-K has an active AI development sub-community which enjoys internal competition to make the strongest non-cheating AI. Now, at the end of this process, Zero-K boasts plenty of singleplayer content while retaining its strong multiplayer roots, alongside new ease-of-use multiplayer features such as matchmaking. </text>
4848
</history>
4949
</histories>
50-
51-
50+
51+
5252
<features>
5353
<feature>Physically simulated units, projectiles and terrain.</feature>
5454
<feature>Terrain manipulation - Explosions leave craters. Constructors dig trenches, erect walls and ramps.</feature>
@@ -63,7 +63,7 @@
6363
<feature>Regular tournaments.</feature>
6464
<feature>Really free, no in-game currency, no unfair multiplayer.</feature>
6565
</features>
66-
66+
6767
<trailers>
6868
<trailer>
6969
<name>Zero-K Launch Trailer</name>
@@ -84,7 +84,6 @@
8484
<description>One of PC Gamers best free games of 2017</description>
8585
<info>PC Gamer</info>
8686
</award>
87-
8887
</awards>
8988

9089
<quotes>
@@ -104,7 +103,7 @@
104103
<additionals>
105104
<additional>
106105
<title>Steam page</title>
107-
<description>Zero-K will be released on Steam, check it out at </description>
106+
<description>Zero-K releases on Steam on the 27th of April 2018 </description>
108107
<link>http://store.steampowered.com/app/334920/ZeroK/</link>
109108
</additional>
110109
<additional>

presskit/index.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
case("founding-date"):
7777
define("COMPANY_DATE", $child);
7878
break;
79+
case("release-date"):
80+
define("GAME_DATE", $child);
81+
break;
7982
case("website"):
8083
define("COMPANY_WEBSITE", $child);
8184
break;
@@ -265,6 +268,10 @@ function parseLink($uri)
265268
<a href="">'. COMPANY_TITLE .'</a><br/>
266269
'. tl('Based in %s', COMPANY_BASED) .'
267270
</p>
271+
<p>
272+
<strong>'. tl('Release date:'). '</strong><br/>
273+
'. GAME_DATE .'
274+
</p>
268275
<p>
269276
<strong>'. tl('Founding date:') .'</strong><br/>
270277
'. COMPANY_DATE .'
@@ -292,9 +299,7 @@ function parseLink($uri)
292299
echo( '<a href="http://'.parseLink($link).'">'.$name.'</a><br/>' );
293300
}
294301

295-
echo ' </p>
296-
<p>
297-
<strong>'. tl('Releases:') .'</strong><br />';
302+
echo ' </p>';
298303

299304
if ($handle = opendir('.')) {
300305
while (false !== ($entry = readdir($handle))) {
@@ -305,8 +310,7 @@ function parseLink($uri)
305310
}
306311
closedir($handle);
307312

308-
echo ' </p>
309-
<p>';
313+
echo ' <p>';
310314

311315
if( count($address) > 0 )
312316
{

0 commit comments

Comments
 (0)