Skip to content

Commit

Permalink
Fix placement of moveable plants in micro world's mini game and harve…
Browse files Browse the repository at this point in the history
…st test
  • Loading branch information
sylestra committed Sep 30, 2016
1 parent b124a12 commit 87676b6
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 21 deletions.
66 changes: 46 additions & 20 deletions worlds/harvest_test_world.lua
@@ -1,36 +1,62 @@
local MicroWorld = require 'micro_world'
local Point3 = _radiant.csg.Point3

local MicroWorld = require 'microworld.micro_world'
local HarvestTest = class(MicroWorld)

function HarvestTest:__init()
self[MicroWorld]:__init(128)
self:create_world()

local player_id = self:get_session().player_id

-- place some trees around the world
self:place_item('stonehearth:trees:oak:large', -25, -25, player_id)
self:place_item('stonehearth:trees:oak:medium', -5, -25, player_id)
self:place_item('stonehearth:trees:oak:small', 15, -25, player_id)
local z = -35
self:place_item('stonehearth:trees:oak:ancient', -45, z)
self:place_item('stonehearth:trees:oak:large', -25, z)
self:place_item('stonehearth:trees:oak:medium', -5, z)
self:place_item('stonehearth:trees:oak:small', 15, z)

self:place_item('stonehearth:trees:juniper:large', -25, -5, player_id)
self:place_item('stonehearth:trees:juniper:medium', -5, -5, player_id)
self:place_item('stonehearth:trees:juniper:small', 15, -5, player_id)
z = z + 20
self:place_item('stonehearth:trees:juniper:ancient', -45, z)
self:place_item('stonehearth:trees:juniper:large', -25, z)
self:place_item('stonehearth:trees:juniper:medium', -5, z)
self:place_item('stonehearth:trees:juniper:small', 15, z)

-- place some boulders. those can be harvested, too!
self:place_item('stonehearth:boulder:large_1', -25, 5, player_id)
self:place_item('stonehearth:boulder:medium_1', -15, 5, player_id)
self:place_item('stonehearth:boulder:small', -5, 5, player_id)
z = z + 20
self:place_item('stonehearth:trees:pine:large', -25, z)
self:place_item('stonehearth:trees:pine:medium', -5, z)
self:place_item('stonehearth:trees:pine:small', 15, z)

self:place_item('stonehearth:boulder:small', 5, 5, player_id)
:add_component('mob'):turn_to(90)
z = z + 20
self:place_item('stonehearth:trees:acacia:large', -45, z)
self:place_item('stonehearth:trees:acacia:small', -15, z)
self:place_item('stonehearth:trees:cactus:large', 15, z)
self:place_item('stonehearth:trees:cactus:small', 35, z)

self:place_item('stonehearth:boulder:small', 15, 5, player_id)
z = z + 10
self:place_item('stonehearth:boulder:large_1', -45, z)
self:place_item('stonehearth:boulder:large_2', -35, z)
self:place_item('stonehearth:boulder:medium_1', -25, z)
self:place_item('stonehearth:boulder:medium_2', -15, z)
self:place_item('stonehearth:boulder:medium_3', -5, z)
self:place_item('stonehearth:boulder:small', 5, z)
self:place_item('stonehearth:boulder:small', 15, z)
:add_component('mob'):turn_to(90)
self:place_item('stonehearth:boulder:small', 25, z)
:add_component('mob'):turn_to(180)
self:place_item('stonehearth:boulder:small', 35, z)
:add_component('mob'):turn_to(280)

z = z + 10
self:place_item('stonehearth:plants:berry_bush', -45, z, nil, {force_iconic=false})
self:place_item('stonehearth:plants:silkweed', -35, z, nil, {force_iconic=false})
self:place_item('stonehearth:plants:brightbell', -25, z, nil, {force_iconic=false})
self:place_item('stonehearth:plants:frostsnap', -15, z, nil, {force_iconic=false})
self:place_item('stonehearth:plants:tumbleweed', -5, z, nil, {force_iconic=false})
self:place_item('stonehearth:plants:pear_cactus', 5, z, nil, {force_iconic=false})
self:place_item('stonehearth:plants:cactus', 10, z, nil, {force_iconic=false})

self:place_item('stonehearth:plants:berry_bush', -25, 15, player_id)
self:place_item('stonehearth:plants:berry_bush', -15, 15, player_id)
self:place_item('stonehearth:plants:silkweed', -5, 15, player_id)
self:place_item('stonehearth:containers:log_pile', 15, z, nil, {force_iconic=false})
self:place_item('stonehearth:containers:stone_pile', 25, z, nil, {force_iconic=false})
self:place_item('stonehearth:containers:wheat_pile', 35, z, nil, {force_iconic=false})
self:place_item('stonehearth:containers:clay_pile', 45, z, nil, {force_iconic=false})

-- add two workers.
self:place_citizen(12, 12)
Expand Down
2 changes: 1 addition & 1 deletion worlds/mini_game_world.lua
Expand Up @@ -18,7 +18,7 @@ function MiniGame:__init()
-- add some bushes so our citizens don't starve
for x = 1,4 do
for z = 1,2 do
self:place_item('stonehearth:plants:berry_bush', 4 + x * 4, 2 + z * 4)
self:place_item('stonehearth:plants:berry_bush', 8 + x * 4, 2 + z * 4, player_id, {force_iconic=false})
end
end

Expand Down

0 comments on commit 87676b6

Please sign in to comment.