[Add] New factions, ship, station, system. Empire and Collective wage war against each other.
This commit is contained in:
parent
d246c2cbe2
commit
309ac8a648
@ -56,4 +56,21 @@
|
||||
<pilot chance='50'>Drone</pilot>
|
||||
</pilots>
|
||||
</fleet>
|
||||
<fleet name="Empire Lancer">
|
||||
<ai>empire</ai>
|
||||
<faction>Empire</faction>
|
||||
<pilots>
|
||||
<pilot chance='100'>Lancer</pilot>
|
||||
</pilots>
|
||||
</fleet>
|
||||
<fleet name="Empire Sml Defence">
|
||||
<ai>empire</ai>
|
||||
<faction>Empire</faction>
|
||||
<pilots>
|
||||
<pilot chance='100'>Lancer</pilot>
|
||||
<pilot chance='80'>Lancer</pilot>
|
||||
<pilot chance='60'>Lancer</pilot>
|
||||
<pilot chance='50'>Hawking</pilot>
|
||||
</pilots>
|
||||
</fleet>
|
||||
</Fleets>
|
||||
|
@ -38,4 +38,23 @@
|
||||
<exterior>saracraft.png</exterior>
|
||||
</GFX>
|
||||
</planet>
|
||||
<planet name="Omega Station">
|
||||
<pos>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
</pos>
|
||||
<general>
|
||||
<class>A</class>
|
||||
<description>Built to defend the Empire from the Collective. The Omega Station has been the observer of countless battles fought in it's sector. It's helped keep a stalemate in the sector.</description>
|
||||
<bar>The Omega Canteen is a dark place that seems calm, although everytime a robotic drone approaches, an alarm is sounded, sending pilots to man their ships to fight off the menace.</bar>
|
||||
<faction>Empire</faction>
|
||||
<services>7</services>
|
||||
<tech>0</tech>
|
||||
<commodities>1</commodities>
|
||||
</general>
|
||||
<GFX>
|
||||
<space>station00.png</space>
|
||||
<exterior>station00.png</exterior>
|
||||
</GFX>
|
||||
</planet>
|
||||
</Planets>
|
||||
|
40
dat/ship.xml
40
dat/ship.xml
@ -61,6 +61,39 @@
|
||||
<outfits>
|
||||
<outfit quantity ='2'>Laser</outfit>
|
||||
</outfits>
|
||||
</ship>
|
||||
<ship name="Hawking">
|
||||
<GFX>hawking</GFX>
|
||||
<GUI>minimal</GUI>
|
||||
<sound>engine</sound>
|
||||
<class>3</class>
|
||||
<price>7500000</price>
|
||||
<fabricator>VLSoft</fabricator>
|
||||
<description>A heavy frigate designed for heavy combat. Used widely by the Empire to esablish control on it's territory. The Hawking has more than enough firepower to not be taken lightly.</description>
|
||||
<movement>
|
||||
<thrust>200</thrust>
|
||||
<turn>90</turn>
|
||||
<speed>260</speed>
|
||||
</movement>
|
||||
<health>
|
||||
<shield>1040</shield>
|
||||
<armour>720</armour>
|
||||
<energy>900</energy>
|
||||
<shield_regen>300</shield_regen>
|
||||
<armour_regen>80</armour_regen>
|
||||
<energy_regen>50</energy_regen>
|
||||
</health>
|
||||
<characteristics>
|
||||
<crew>35</crew>
|
||||
<mass>500</mass>
|
||||
<cap_weapon>180</cap_weapon>
|
||||
<cap_cargo>70</cap_cargo>
|
||||
</characteristics>
|
||||
<outfits>
|
||||
<outfit quantity="2">Laser Turret</outfit>
|
||||
<outfit quantity="2">Headhunter Launcher</outfit>
|
||||
<outfit quantity="40">Headhunter</outfit>
|
||||
</outfits>
|
||||
</ship>
|
||||
<ship name="Lancer">
|
||||
<GFX>lancer</GFX>
|
||||
@ -69,8 +102,7 @@
|
||||
<class>2</class>
|
||||
<price>700000</price>
|
||||
<fabricator>VLSoft</fabricator>
|
||||
<description>On of VLSoft's prize heavey fighters. Was originally a secret design for the Empire military, but then disclosed. Now a modified version is available for civilians, although it doesn't meet up to the original specifications.
|
||||
Used by security agencies all over the universe for it's reliability and availability. Proudly enforcing your security since STARDATE.</description>
|
||||
<description>On of VLSoft's prize heavey fighters. Was originally a secret design for the Empire military, but then disclosed. Now a modified version is available for civilians, although it doesn't meet up to the original specifications. Used by security agencies all over the universe for it's reliability and availability. Proudly enforcing your security since STARDATE.</description>
|
||||
<movement>
|
||||
<thrust>280</thrust>
|
||||
<turn>135</turn>
|
||||
@ -92,8 +124,8 @@
|
||||
</characteristics>
|
||||
<outfits>
|
||||
<outfit quantity="4">Laser</outfit>
|
||||
<outfit quantity="2">Missile Launcher</outfit>
|
||||
<outfit quantity="20">Missile</outfit>
|
||||
<outfit quantity="2">Headhunter Launcher</outfit>
|
||||
<outfit quantity="20">Headhunter</outfit>
|
||||
</outfits>
|
||||
</ship>
|
||||
<ship name="Merchant Mule">
|
||||
|
16
dat/ssys.xml
16
dat/ssys.xml
@ -61,12 +61,18 @@
|
||||
<interference>0</interference>
|
||||
</general>
|
||||
<planets>
|
||||
<planet>Omega Station</planet>
|
||||
</planets>
|
||||
<fleets>
|
||||
<fleet chance="80">Merchant Ship</fleet>
|
||||
<fleet chance="60">Merchant Mule</fleet>
|
||||
<fleet chance="60">Pirate</fleet>
|
||||
<fleet chance="60">Pirate</fleet>
|
||||
<fleet chance="80">Merchant Mule</fleet>
|
||||
<fleet chance="60">Merchant Ship</fleet>
|
||||
<fleet chance="80">Empire Lancer</fleet>
|
||||
<fleet chance="60">Empire Lancer</fleet>
|
||||
<fleet chance="50">Empire Sml Defence</fleet>
|
||||
<fleet chance="80">Collective Drone</fleet>
|
||||
<fleet chance="60">Collective Drone</fleet>
|
||||
<fleet chance="50">Collective Sml Swarm</fleet>
|
||||
|
||||
</fleets>
|
||||
<jumps>
|
||||
<jump>SaraSys</jump>
|
||||
@ -89,8 +95,6 @@
|
||||
<fleets>
|
||||
<fleet chance="80">Merchant Ship</fleet>
|
||||
<fleet chance="60">Merchant Mule</fleet>
|
||||
<fleet chance="60">Pirate</fleet>
|
||||
<fleet chance="60">Pirate</fleet>
|
||||
</fleets>
|
||||
<jumps>
|
||||
<jump>NCG-7291</jump>
|
||||
|
BIN
gfx/planet/exterior/station00.png
Normal file
BIN
gfx/planet/exterior/station00.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 146 KiB |
BIN
gfx/planet/space/station00.png
Normal file
BIN
gfx/planet/space/station00.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
BIN
gfx/ship/hawking.png
Normal file
BIN
gfx/ship/hawking.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 195 KiB |
BIN
gfx/ship/hawking_target.png
Normal file
BIN
gfx/ship/hawking_target.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.7 KiB |
112
scripts/ai/empire.lua
Normal file
112
scripts/ai/empire.lua
Normal file
@ -0,0 +1,112 @@
|
||||
-- Required control rate
|
||||
control_rate = 2
|
||||
|
||||
-- Required "control" function.
|
||||
function control()
|
||||
task = ai.taskname()
|
||||
|
||||
enemy = ai.getenemy()
|
||||
if enemy ~= 0 then
|
||||
ai.pushtask(0, "attack", enemy)
|
||||
elseif task == "none" then
|
||||
planet = ai.rndplanet()
|
||||
-- Planet needs to exist..
|
||||
if planet == nil then
|
||||
ai.pushtask(0, "hyperspace")
|
||||
else
|
||||
ai.pushtask(0, "go", planet)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function attacked(attacker)
|
||||
task = ai.taskname()
|
||||
if task ~= "attack" and task ~= "runaway" then
|
||||
taunt(attacker)
|
||||
|
||||
ai.pushtask(0, "attack", attacker)
|
||||
elseif task == "attack" then
|
||||
if ai.targetid() ~= attacker then
|
||||
ai.pushtask(0, "attack", attacker)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function create()
|
||||
if ai.rnd(0,2)==0 then
|
||||
ai.broadcast("The Empire is watching")
|
||||
end
|
||||
end
|
||||
|
||||
function taunt(target)
|
||||
num = ai.rnd(0,4)
|
||||
if num == 0 then msg = "How dare you attack me!?"
|
||||
elseif num == 1 then msg = "You can not defeat the Empire!"
|
||||
elseif num == 2 then msg = "You will hang for this!"
|
||||
elseif num == 3 then msg = "DIE!"
|
||||
end
|
||||
if msg then ai.comm(attacker, msg) end
|
||||
end
|
||||
|
||||
function attack()
|
||||
target = ai.targetid()
|
||||
|
||||
-- Make sure pilot exists.
|
||||
if not ai.exists(target) then
|
||||
ai.poptask()
|
||||
return
|
||||
end
|
||||
|
||||
dir = ai.face(target)
|
||||
dist = ai.dist(ai.pos(target))
|
||||
second = ai.secondary()
|
||||
|
||||
if ai.secondary() == "Launcher" then
|
||||
ai.settarget(target)
|
||||
ai.shoot(2)
|
||||
end
|
||||
|
||||
if dir < 10 and dist > 300 then
|
||||
ai.accel()
|
||||
elseif dir < 10 and dist < 300 then
|
||||
ai.shoot()
|
||||
end
|
||||
end
|
||||
|
||||
function go()
|
||||
target = ai.target()
|
||||
dir = ai.face(target)
|
||||
dist = ai.dist(target)
|
||||
bdist = ai.minbrakedist()
|
||||
if dir < 10 and dist > bdist then
|
||||
ai.accel()
|
||||
elseif dir < 10 and dist < bdist then
|
||||
ai.poptask()
|
||||
ai.pushtask(0, "stop")
|
||||
end
|
||||
end
|
||||
|
||||
function stop()
|
||||
if ai.isstopped() then
|
||||
ai.stop()
|
||||
ai.poptask()
|
||||
ai.settimer(0, ai.rnd(8000, 15000))
|
||||
ai.pushtask(0, "land")
|
||||
else
|
||||
ai.brake()
|
||||
end
|
||||
end
|
||||
|
||||
function land()
|
||||
if ai.timeup(0) then
|
||||
ai.pushtask(0, "hyperspace")
|
||||
end
|
||||
end
|
||||
|
||||
function hyperspace()
|
||||
dir = ai.face(-1) -- Face away from (0,0)
|
||||
if(dir < 10) then
|
||||
ai.accel()
|
||||
end
|
||||
end
|
||||
|
@ -131,6 +131,7 @@ void planets_minimap(const double res,
|
||||
|
||||
static PlanetClass planetclass_get(const char a) {
|
||||
switch(a) {
|
||||
// Planets use letters.
|
||||
case 'A': return PLANET_CLASS_A;
|
||||
case 'B': return PLANET_CLASS_B;
|
||||
case 'C': return PLANET_CLASS_C;
|
||||
@ -155,6 +156,9 @@ static PlanetClass planetclass_get(const char a) {
|
||||
case 'Y': return PLANET_CLASS_Y;
|
||||
case 'Z': return PLANET_CLASS_Z;
|
||||
|
||||
// Stations use numbers as there isn't as many.
|
||||
case '0' : return STATION_CLASS_A;
|
||||
|
||||
default: return PLANET_CLASS_NULL;
|
||||
};
|
||||
}
|
||||
|
@ -31,7 +31,8 @@ typedef enum PlanetClass_ {
|
||||
PLANET_CLASS_T, // Ultragiant.
|
||||
PLANET_CLASS_X, // Demon.
|
||||
PLANET_CLASS_Y, // Demon.
|
||||
PLANET_CLASS_Z // Demon.
|
||||
PLANET_CLASS_Z, // Demon.
|
||||
STATION_CLASS_A // TODO.
|
||||
} PlanetClass;
|
||||
|
||||
// Planet services.
|
||||
|
Loading…
Reference in New Issue
Block a user