Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hired Escorts reimplemented as Hireable Vagabonds with mini-personalities #2152

Open
wants to merge 67 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
e03d599
Add files via upload
ThrosturX Jun 30, 2022
9bbf3c0
Update scavenger_event.lua
ThrosturX Jun 30, 2022
ff7be69
Update faction.xml
ThrosturX Jun 30, 2022
9af6b90
Add files via upload
ThrosturX Jun 30, 2022
34e7e08
Add files via upload
ThrosturX Jun 30, 2022
bda543a
Add files via upload
ThrosturX Jun 30, 2022
46cd412
Add files via upload
ThrosturX Jun 30, 2022
e6aefbb
Update scavenger_event.lua
ThrosturX Jul 1, 2022
4cc214b
Add files via upload
ThrosturX Jul 1, 2022
ada96e4
Merge branch 'naev:main' into ThrosturX-escorts
ThrosturX Jul 1, 2022
eaa6548
Update wrapper.lua
ThrosturX Jul 1, 2022
0a5243b
Update escort.lua
ThrosturX Jul 1, 2022
419d1a8
Update escort.lua
ThrosturX Jul 1, 2022
47d789e
Update scavenger_event.lua
ThrosturX Jul 1, 2022
88dc772
Merge branch 'naev:main' into ThrosturX-escorts
ThrosturX Jul 4, 2022
9f638f3
Add files via upload
ThrosturX Jul 4, 2022
bc6aa8a
Add files via upload
ThrosturX Jul 4, 2022
fc12498
Add files via upload
ThrosturX Jul 4, 2022
ca79441
Merge branch 'naev:main' into ThrosturX-escorts
ThrosturX Jul 7, 2022
7eddc56
Add files via upload
ThrosturX Jul 7, 2022
373d9b7
Add files via upload
ThrosturX Jul 7, 2022
3ec765a
Add files via upload
ThrosturX Jul 7, 2022
b77cf6d
Delete escort.lua
ThrosturX Jul 7, 2022
0f1196f
Add files via upload
ThrosturX Jul 7, 2022
fdf688f
Add files via upload
ThrosturX Jul 7, 2022
ea6bb81
Add files via upload
ThrosturX Jul 7, 2022
8cd1beb
Update wrapper.lua
ThrosturX Jul 7, 2022
ebb7973
Merge branch 'naev:main' into ThrosturX-escorts
ThrosturX Jul 7, 2022
5918050
Add files via upload
ThrosturX Jul 7, 2022
ac8ccb2
Add files via upload
ThrosturX Jul 8, 2022
3f8b957
Add files via upload
ThrosturX Jul 8, 2022
e2c7b9c
Create placeholder.png
ThrosturX Jul 10, 2022
06b65bb
Add files via upload
ThrosturX Jul 10, 2022
f1fc17d
Delete dat/gui/gfx/portraits/neutral/unique directory
ThrosturX Jul 10, 2022
322e22e
Create placeholder.png
ThrosturX Jul 10, 2022
79bf216
Add files via upload
ThrosturX Jul 10, 2022
0c76dd4
Add files via upload
ThrosturX Jul 10, 2022
02b0e34
Create escort_menu.png
ThrosturX Jul 10, 2022
5776c85
Add files via upload
ThrosturX Jul 10, 2022
9a08cba
Add files via upload
ThrosturX Jul 10, 2022
f0df05c
Add files via upload
ThrosturX Jul 10, 2022
43ab692
hopefully all the changes
ThrosturX Jul 10, 2022
d9f8735
Merge branch 'main' into ThrosturX-escorts
ThrosturX Jul 10, 2022
9319b62
Merge pull request #1 from naev/main
ThrosturX Jul 10, 2022
02507e6
typos mostly
ThrosturX Jul 10, 2022
0878b2c
Merge branch 'naev:main' into ThrosturX-escorts
ThrosturX Jul 11, 2022
b5bfa4d
Merge branch 'naev:main' into ThrosturX-escorts
ThrosturX Jul 12, 2022
4a513fc
mem.autoleader
ThrosturX Jul 12, 2022
d42d046
various fixes and improvements
ThrosturX Jul 13, 2022
659a2ab
Merge branch 'naev:main' into ThrosturX-escorts
ThrosturX Jul 13, 2022
3c00ab1
fix wrong portrait bug
ThrosturX Jul 13, 2022
dc1691f
Merge branch 'ThrosturX-escorts' of https://github.com/ThrosturX/naev…
ThrosturX Jul 13, 2022
6012bb9
Merge branch 'naev:main' into ThrosturX-escorts
ThrosturX Jul 14, 2022
3021826
minor fixes
ThrosturX Jul 14, 2022
e066129
Merge branch 'naev:main' into ThrosturX-escorts
ThrosturX Jul 22, 2022
122774d
Update human.lua
ThrosturX Jul 22, 2022
dd7e4a7
Update artwork
ThrosturX Jul 22, 2022
a53b188
Merge branch 'ThrosturX-escorts' of https://github.com/ThrosturX/naev…
ThrosturX Jul 22, 2022
ebaf737
fix some luacheck errors
ThrosturX Aug 1, 2022
dfc2b38
Merge branch 'naev:main' into ThrosturX-escorts
ThrosturX Aug 1, 2022
3a09aa1
more luacheck stuff
ThrosturX Aug 1, 2022
7ebdbfd
Merge branch 'ThrosturX-escorts' of https://github.com/ThrosturX/naev…
ThrosturX Aug 1, 2022
8d6f66e
Update scavenger_event.lua
ThrosturX Aug 1, 2022
c8ffdc1
Merge branch 'naev:main' into ThrosturX-escorts
ThrosturX Aug 1, 2022
b41e1fa
Merge branch 'naev:main' into ThrosturX-escorts
ThrosturX Aug 1, 2022
3a0b521
outfits -> outfitsList
ThrosturX Aug 14, 2022
d0ebe6e
Merge branch 'naev:main' into ThrosturX-escorts
ThrosturX Aug 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2,077 changes: 2,077 additions & 0 deletions dat/events/scavenger_event.lua

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions dat/faction.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
<allies />
<enemies />
</faction>
<faction>
<name>Affiliated</name>
<ai>pirate</ai>
<equip>escort</equip>
<static />
<invisible />
<known />
<player>0</player>
<standing>static</standing>
<allies />
<enemies />
</faction>
<faction>
<name>Independent</name>
<ai>independent</ai>
Expand Down
9 changes: 9 additions & 0 deletions dat/factions/equip/escort.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
local equipopt = require 'equipopt'
--[[
-- @brief Does Escort pilot equipping
--
-- @param p Pilot to equip
--]]
function equip( p )
return equipopt.escort( p )
end
23 changes: 23 additions & 0 deletions dat/outfits/intrinsic/escort_bonus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version='1.0' encoding='UTF-8'?>
<outfit name="Integrated Shielding">
<general>
<slot>intrinsic</slot>
<mass>0</mass>
<price>1000000</price>
<description>The "Integrated Shielding" service provides a full retweak and overhaul of the systems shielding circuitry. The optimizations are able to greatly increase the power with only a slight drawback to the electronics and weapons systems. Due to the nature of the service, only one can be applied to each ship.</description>
<gfx_store>placeholder.webp</gfx_store>
<rarity>6</rarity>
</general>
<specific type="modification">
<armour_regen>3</armour_regen>
<armour_mod>20</armour_mod>
<shield_mod>20</shield_mod>
<shield_regen_mod>20</shield_regen_mod>
<energy_mod>30</energy_mod>
<energy_regen_mod>20</energy_regen_mod>
<fwd_firerate>-20</fwd_firerate>
<tur_firerate>-20</tur_firerate>
<launch_rate>-20</launch_rate>
<stress_dissipation>-20.000000</stress_dissipation>
</specific>
</outfit>
186 changes: 186 additions & 0 deletions dat/scripts/equipopt/templates/escort.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
local optimize = require 'equipopt.optimize'
local ecores = require 'equipopt.cores'
local eoutfits = require 'equipopt.outfits'
local eparams = require 'equipopt.params'

local function choose_one( t ) return t[ rnd.rnd(1,#t) ] end

local escort_outfits = eoutfits.merge{{
-- Heavy Weapons
"Lancelot Bay",
"Hyena Dock",
"Pirate Hyena Bay",
"Turbolaser", "Heavy Ripper Turret", "Railgun Turret", "Ragnarok Beam",
"Railgun", "Heavy Laser Turret", "Grave Beam", "Heavy Ion Turret",
"Heavy Laser Turret",
-- Medium Weapons
"Heavy Ripper Cannon",
"Enygma Systems Turreted Fury Launcher",
"Enygma Systems Turreted Headhunter Launcher",
"Laser Turret MK2", "Razor Turret MK2", "Turreted Vulcan Gun",
"Plasma Turret MK2", "Orion Beam", "EMP Grenade Launcher",
"TeraCom Headhunter Launcher",
"TeraCom Medusa Launcher", "TeraCom Vengeance Launcher",
"Enygma Systems Spearhead Launcher", "Unicorp Caesar IV Launcher",
"TeraCom Fury Launcher", "TeraCom Headhunter Launcher",
"TeraCom Medusa Launcher", "TeraCom Vengeance Launcher",
"TeraCom Imperator Launcher",
"Laser Cannon MK2", "Razor MK2", "Vulcan Gun", "Plasma Blaster MK2",
"Grave Lance", "Orion Lance", "Ion Cannon",
-- Small Weapons
"Laser Cannon MK1", "Razor MK1", "Gauss Gun", "Plasma Blaster MK1",
"Laser Turret MK1", "Razor Turret MK1", "Turreted Gauss Gun",
"Plasma Turret MK1", "Particle Beam", "Particle Lance",
"TeraCom Mace Launcher", "TeraCom Banshee Launcher",
"TeraCom Banshee Launcher",
-- Utility
"Unicorp Scrambler", "Unicorp Light Afterburner",
"Sensor Array", "Hellburner", "Emergency Shield Booster",
"Unicorp Medium Afterburner", "Droid Repair Crew",
"Scanning Combat AI", "Hunting Combat AI",
"Photo-Voltaic Nanobot Coating",
"Adaptive Stealth Plating",
"Blink Drive",
"Milspec Scrambler",
"Targeting Array", "Agility Combat AI",
"Milspec Jammer", "Weapons Ionizer",
"Faraday Tempest Coating", "Hive Combat AI",
-- Heavy Structural
"Biometal Armour",
"Battery IV", "Large Fuel Pod",
"Battery III", "Shield Capacitor III", "Shield Capacitor IV",
"Reactor Class III",
"Large Shield Booster",
-- Medium Structural
"Battery II", "Shield Capacitor II", "Reactor Class II",
"Active Plating", "Medium Shield Booster",
-- Small Structural
"Battery I", "Shield Capacitor I", "Reactor Class I",
"Small Shield Booster",
}}

local escort_class = { "standard", "elite" }

local escort_params = {
["Kestrel"] = function () return {
type_range = {
["Launcher"] = { max = 2 },
},
} end,
["Pirate Kestrel"] = function () return {
prefer = {
[ "Enygma Systems Spearhead Launcher"] = 7, ["TeraCom Headhunter Launcher"] = 4,
["TeraCom Medusa Launcher"] = 3, ["Enygma Systems Turreted Fury Launcher"] = 2
},
type_range = {
["Launcher"] = { max = 4 },
},
} end,
["Mule"] = function() return {
fighterbay = 1.2,
disable = 1.1,
move = 0.5,
prefer = { ["Blink Drive"] = 30, ["Milspec Jammer"] = 40, ["Droid Repair Crew"] = 2 },
type_range = {
[ "Launcher" ] = { max=1 },
[ "Beam Weapon" ] = { min=1, max=2 }
},
} end,
}

local escort_cores = {
["Pirate Kestrel"] = function (p)
local c = ecores.get( p, { systems=escort_class, hulls=escort_class, heavy=false } )
table.insert( c, choose_one{ "Nexus Bolt 3500 Engine", "Krain Remige Engine", "Tricon Typhoon Engine", } )
return c
end,
["Kestrel"] = function () return {
choose_one{ "Unicorp PT-2200 Core System", "Milspec Orion 8601 Core System", "Milspec Thalos 9802 Core System", "Milspec Orion 9901 Core System" },
choose_one{ "Nexus Bolt 3500 Engine", "Krain Remige Engine", "Tricon Typhoon Engine", },
choose_one{ "Unicorp D-48 Heavy Plating", "S&K Heavy Combat Plating" },

} end,
["Starbridge"] = function (p)
local c = ecores.get( p, { systems=escort_class, hulls=escort_class, heavy=false } )
table.insert( c, choose_one{ "Unicorp Falcon 1300 Engine", "Krain Patagium Engine", "Tricon Cyclone Engine"} )
return c
end,
["Shark"] = function () return {
choose_one{ "Milspec Orion 2301 Core System", "Milspec Thalos 2202 Core System" },
"Tricon Zephyr Engine",
choose_one{ "Nexus Light Stealth Plating", "S&K Ultralight Combat Plating" },
} end,
["Empire Shark"] = function () return {
choose_one{ "Milspec Orion 2301 Core System", "Milspec Thalos 2202 Core System" },
"Tricon Zephyr Engine",
choose_one{ "Nexus Light Stealth Plating", "S&K Ultralight Combat Plating" },
} end,
["Mule"] = function() return {
choose_one{ "Milspec Orion 5501 Core System", "Milspec Thalos 5402 Core System", "Unicorp PT-310 Core System" },
"Melendez Buffalo XL Engine",
choose_one{"S&K Medium Combat Plating", "Unicorp D-24 Medium Plating", "S&K Medium-Heavy Combat Plating", "Patchwork Medium Plating" },
} end,
}

local escort_params_overwrite = {
weap = 1.5, -- Focus on weapons
disable = 2.4, -- prefer disablers
-- some nice preferable escort outfits
prefer = {
[ "TeraCom Medusa Launcher"] = 6 , ["TeraCom Medusa Launcher"] = 2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're defining "TeraCom Medusa Launcher" twice.

[ "Enygma Systems Spearhead Launcher"] = 4, ["TeraCom Headhunter Launcher"] = 10, ["Large Shield Booster"] = 2,
[ "Shield Capacitor IV"] = 2
},


-- not too much diversity, but some
max_same_stru = 2,
max_same_util = 1,
cargo = 0.0,
constant = 4,
rnd = 0.3,
}

--[[
-- @brief Does Escort pilot equipping
--
-- @param p Pilot to equip
--]]
local function equip_escort( p, opt_params )
opt_params = opt_params or {}
local ps = p:ship()
local sname = ps:nameRaw()

-- Choose parameters and make Pirateish
local params = eparams.choose( p, escort_params_overwrite )
params.rnd = params.rnd * 1.5
if ps:size() < 3 then
params.max_same_weap = 2
else
params.max_same_weap = 3
end
params.max_mass = 0.95 + 1.2*rnd.rnd()
-- Per ship tweaks
local sp = escort_params[ sname ]
if sp then
params = tmerge_r( params, sp() )
end
params = tmerge_r( params, opt_params )

-- See cores
local cores
local esccor = escort_cores[ sname ]
if esccor then
cores = esccor( p )
else
cores = ecores.get( p, { all=escort_class } )
end

local mem = p:memory()
mem.equip = { type="scavenger", level="standard" }

-- Try to equip
return optimize.optimize( p, cores, escort_outfits, params )
end

return equip_escort
2 changes: 2 additions & 0 deletions dat/scripts/equipopt/wrapper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ equipopt.cores = require 'equipopt.cores'

-- Main equipment functions
equipopt.generic = require 'equipopt.templates.generic'
equipopt.escort = require 'equipopt.templates.escort'
equipopt.empire = require 'equipopt.templates.empire'
equipopt.zalek = require 'equipopt.templates.zalek'
equipopt.dvaered = require 'equipopt.templates.dvaered'
Expand All @@ -13,4 +14,5 @@ equipopt.soromid = require 'equipopt.templates.soromid'
equipopt.pirate = require 'equipopt.templates.pirate'
equipopt.thurion = require 'equipopt.templates.thurion'
equipopt.proteron = require 'equipopt.templates.proteron'
equipopt.scavenger = require 'equipopt.templates.scavenger'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you committed the scavenger template.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be needed, artifact from my other modding activity...

return equipopt
1 change: 1 addition & 0 deletions dat/scripts/pilotname/core.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
local pilotname = {}

pilotname.generic = require 'pilotname.generic'
pilotname.human = require 'pilotname.human'
pilotname.pirate = require 'pilotname.pirate'

return pilotname