[Mod] Crusader mod [A18]

local ArenaWorld = class()
local Point3 = _radiant.csg.Point3

function ArenaWorld:start()

microworld:create_world(50)

– Create all the Goodies.
local goodies = {}
for x = 1,3 do
for z = 1,2 do
local footman = microworld:place_citizen(-5 + (x * 3), -5 + (z * 3), ‘stonehearth:jobs:footman’)
table.insert(goodies, footman)
end
end
self._baddies()
end

– Rip off and murder Radiants create_citizen function :smiley:

function ArenaWorld:place_baddies(x, z, job)
local ENEMY_PLAYER = ‘goblins’
local pop = stonehearth.population:get_population(ENEMY_PLAYER)
local citizen = pop:create_new_citizen()

job = job or ‘stonehearth:jobs:worker’

citizen:add_component(‘stonehearth:job’)
:promote_to(job)

radiant.terrain.place_entity(citizen, Point3(x, 1, z))
return citizen
end

function ArenaWorld:_baddies(x, z, job)

– Create all the Baddies.
local baddies = {}
for x = 1,4 do
for z = 1,4 do
local footman = ArenaWorld:place_baddies(-5 + (x * 3), -5 + (z * 3), ‘stonehearth:jobs:footman’)
table.insert(baddies, footman)
end
end

end

return ArenaWorld

Change the goodie job to your crusader, and it should work ~ works for me anyway.

There are probably better way to achieve this, but I’m still learning, so … bite me… :smiley:

arena_world.txt (1.1 KB)

Rename to .lua and run as a microworld

4 Likes