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"
module(..., package.seeall, class.inherit(mod.class.Actor, engine.interface.ActorAI))
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)
ActorAI.init(self, t)
end
......
......@@ -21,7 +21,7 @@ class = require("mod.class.WorldNPC")
newEntity{
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,
faction = "allied-kingdoms",
level_range = {1, nil},
......@@ -33,7 +33,7 @@ newEntity{
newEntity{
name = "Allied Kingdoms halfling patrol",
type = "patrol", subtype = "allied kingdoms", cant_be_moved=true,
type = "patrol", subtype = "allied kingdoms",
display = 'p', color = colors.UMBER,
faction = "allied-kingdoms",
level_range = {1, nil},
......@@ -45,7 +45,7 @@ newEntity{
newEntity{
name = "lone bear",
type = "hostile", subtype = "animal", cant_be_moved=true,
type = "hostile", subtype = "animal",
display = 'q', color = colors.UMBER,
level_range = {1, nil},
sight = 3,
......@@ -57,7 +57,7 @@ newEntity{
newEntity{
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",
level_range = {1, nil},
sight = 3,
......@@ -69,7 +69,7 @@ newEntity{
newEntity{
name = "dragon",
type = "hostile", subtype = "dragon", cant_be_moved=true,
type = "hostile", subtype = "dragon",
display = 'D', color = colors.RED,
level_range = {12, nil},
sight = 3,
......
......@@ -40,11 +40,12 @@ newEntity{
local x, y = self:findSpot(who)
if not x then return end
local g = mod.class.NPC.new{
local g = mod.class.WorldNPC.new{
name="Novice mage",
type="humanoid", subtype="elf", faction="angolwen",
display='@', color=colors.RED,
can_talk = "mage-apprentice-quest",
unit_power = 300,
}
g:resolve() g:resolve(nil, true)
game.zone:addEntity(game.level, g, "actor", x, y)
......
......@@ -17,7 +17,7 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
-- Maj'Eyal world map directory AI
-- Maj'Eyal worldmap directory AI
wda.cur_patrols = wda.cur_patrols or 0
wda.cur_hostiles = wda.cur_hostiles or 0
......@@ -27,10 +27,12 @@ if wda.cur_patrols < 3 then
local e = game.zone:makeEntity(game.level, "encounters_npcs", {type="patrol"}, nil, true)
if e then
local spot = game.level:pickSpot{type="patrol", "allied-kingdoms"}
print("Spawned allied kingdom patrol", spot.x, spot.y, e.name)
game.zone:addEntity(game.level, e, "actor", spot.x, spot.y)
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
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
print("Spawned allied kingdom patrol", spot.x, spot.y, e.name)
game.zone:addEntity(game.level, e, "actor", spot.x, spot.y)
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
......@@ -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)
if e then
local spot = game.level:pickSpot{type="hostile", "random"}
print("Spawned hostile", spot.x, spot.y, e.name)
game.zone:addEntity(game.level, e, "actor", spot.x, spot.y)
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
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
print("Spawned hostile", spot.x, spot.y, e.name)
game.zone:addEntity(game.level, e, "actor", spot.x, spot.y)
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
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