Skip to content
Snippets Groups Projects
Commit df792028 authored by dg's avatar dg
Browse files

plop

git-svn-id: http://svn.net-core.org/repos/t-engine4@1689 51575b47-30f0-44d4-a5cc-537603b46e54
parent 8de3226e
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ require "mod.class.Actor" ...@@ -26,6 +26,7 @@ require "mod.class.Actor"
module(..., package.seeall, class.inherit(mod.class.Actor, engine.interface.ActorAI)) module(..., package.seeall, class.inherit(mod.class.Actor, engine.interface.ActorAI))
function _M:init(t, no_default) function _M:init(t, no_default)
if type(t.cant_be_moved) == "nil" then t.cant_be_moved = true end
mod.class.Actor.init(self, t, no_default) mod.class.Actor.init(self, t, no_default)
ActorAI.init(self, t) ActorAI.init(self, t)
end end
......
...@@ -21,7 +21,7 @@ class = require("mod.class.WorldNPC") ...@@ -21,7 +21,7 @@ class = require("mod.class.WorldNPC")
newEntity{ newEntity{
name = "Allied Kingdoms human patrol", name = "Allied Kingdoms human patrol",
type = "patrol", subtype = "allied kingdoms", cant_be_moved=true, type = "patrol", subtype = "allied kingdoms",
display = 'p', color = colors.LIGHT_UMBER, display = 'p', color = colors.LIGHT_UMBER,
faction = "allied-kingdoms", faction = "allied-kingdoms",
level_range = {1, nil}, level_range = {1, nil},
...@@ -33,7 +33,7 @@ newEntity{ ...@@ -33,7 +33,7 @@ newEntity{
newEntity{ newEntity{
name = "Allied Kingdoms halfling patrol", name = "Allied Kingdoms halfling patrol",
type = "patrol", subtype = "allied kingdoms", cant_be_moved=true, type = "patrol", subtype = "allied kingdoms",
display = 'p', color = colors.UMBER, display = 'p', color = colors.UMBER,
faction = "allied-kingdoms", faction = "allied-kingdoms",
level_range = {1, nil}, level_range = {1, nil},
...@@ -45,7 +45,7 @@ newEntity{ ...@@ -45,7 +45,7 @@ newEntity{
newEntity{ newEntity{
name = "lone bear", name = "lone bear",
type = "hostile", subtype = "animal", cant_be_moved=true, type = "hostile", subtype = "animal",
display = 'q', color = colors.UMBER, display = 'q', color = colors.UMBER,
level_range = {1, nil}, level_range = {1, nil},
sight = 3, sight = 3,
...@@ -57,7 +57,7 @@ newEntity{ ...@@ -57,7 +57,7 @@ newEntity{
newEntity{ newEntity{
name = "pack of wolves", name = "pack of wolves",
type = "hostile", subtype = "animal", cant_be_moved=true, type = "hostile", subtype = "animal",
display = 'c', color = colors.RED, image="npc/canine_w.png", display = 'c', color = colors.RED, image="npc/canine_w.png",
level_range = {1, nil}, level_range = {1, nil},
sight = 3, sight = 3,
...@@ -69,7 +69,7 @@ newEntity{ ...@@ -69,7 +69,7 @@ newEntity{
newEntity{ newEntity{
name = "dragon", name = "dragon",
type = "hostile", subtype = "dragon", cant_be_moved=true, type = "hostile", subtype = "dragon",
display = 'D', color = colors.RED, display = 'D', color = colors.RED,
level_range = {12, nil}, level_range = {12, nil},
sight = 3, sight = 3,
......
...@@ -40,11 +40,12 @@ newEntity{ ...@@ -40,11 +40,12 @@ newEntity{
local x, y = self:findSpot(who) local x, y = self:findSpot(who)
if not x then return end if not x then return end
local g = mod.class.NPC.new{ local g = mod.class.WorldNPC.new{
name="Novice mage", name="Novice mage",
type="humanoid", subtype="elf", faction="angolwen", type="humanoid", subtype="elf", faction="angolwen",
display='@', color=colors.RED, display='@', color=colors.RED,
can_talk = "mage-apprentice-quest", can_talk = "mage-apprentice-quest",
unit_power = 300,
} }
g:resolve() g:resolve(nil, true) g:resolve() g:resolve(nil, true)
game.zone:addEntity(game.level, g, "actor", x, y) game.zone:addEntity(game.level, g, "actor", x, y)
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
-- Nicolas Casalini "DarkGod" -- Nicolas Casalini "DarkGod"
-- darkgod@te4.org -- darkgod@te4.org
-- Maj'Eyal world map directory AI -- Maj'Eyal worldmap directory AI
wda.cur_patrols = wda.cur_patrols or 0 wda.cur_patrols = wda.cur_patrols or 0
wda.cur_hostiles = wda.cur_hostiles or 0 wda.cur_hostiles = wda.cur_hostiles or 0
...@@ -27,10 +27,12 @@ if wda.cur_patrols < 3 then ...@@ -27,10 +27,12 @@ if wda.cur_patrols < 3 then
local e = game.zone:makeEntity(game.level, "encounters_npcs", {type="patrol"}, nil, true) local e = game.zone:makeEntity(game.level, "encounters_npcs", {type="patrol"}, nil, true)
if e then if e then
local spot = game.level:pickSpot{type="patrol", "allied-kingdoms"} local spot = game.level:pickSpot{type="patrol", "allied-kingdoms"}
print("Spawned allied kingdom patrol", spot.x, spot.y, e.name) if spot and not game.level.map(spot.x, spot.y, engine.Map.ACTOR) and not game.level.map.seens(spot.x, spot.y) then
game.zone:addEntity(game.level, e, "actor", spot.x, spot.y) print("Spawned allied kingdom patrol", spot.x, spot.y, e.name)
wda.cur_patrols = wda.cur_patrols + 1 game.zone:addEntity(game.level, e, "actor", spot.x, spot.y)
e.on_die = function() game.level.data.wda.cur_patrols = game.level.data.wda.cur_patrols - 1 end wda.cur_patrols = wda.cur_patrols + 1
e.on_die = function() game.level.data.wda.cur_patrols = game.level.data.wda.cur_patrols - 1 end
end
end end
end end
...@@ -39,9 +41,11 @@ if wda.cur_hostiles < 4 and rng.percent(5) then ...@@ -39,9 +41,11 @@ if wda.cur_hostiles < 4 and rng.percent(5) then
local e = game.zone:makeEntity(game.level, "encounters_npcs", {type="hostile"}, nil, true) local e = game.zone:makeEntity(game.level, "encounters_npcs", {type="hostile"}, nil, true)
if e then if e then
local spot = game.level:pickSpot{type="hostile", "random"} local spot = game.level:pickSpot{type="hostile", "random"}
print("Spawned hostile", spot.x, spot.y, e.name) if spot and not game.level.map(spot.x, spot.y, engine.Map.ACTOR) and not game.level.map.seens(spot.x, spot.y) then
game.zone:addEntity(game.level, e, "actor", spot.x, spot.y) print("Spawned hostile", spot.x, spot.y, e.name)
wda.cur_hostiles = wda.cur_hostiles + 1 game.zone:addEntity(game.level, e, "actor", spot.x, spot.y)
e.on_die = function() game.level.data.wda.cur_hostiles = game.level.data.wda.cur_hostiles - 1 end wda.cur_hostiles = wda.cur_hostiles + 1
e.on_die = function() game.level.data.wda.cur_hostiles = game.level.data.wda.cur_hostiles - 1 end
end
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment