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

tests

git-svn-id: http://svn.net-core.org/repos/t-engine4@4311 51575b47-30f0-44d4-a5cc-537603b46e54
parent 64fc6ea3
No related branches found
No related tags found
No related merge requests found
......@@ -605,6 +605,7 @@ end
function _M:removeTemporaryValue(prop, id, noupdate)
local oldval = self.compute_vals[id]
print("removeTempVal", prop, oldval, " :=: ", id)
print(table.serialize(self.compute_vals,1,1))
self.compute_vals[id] = nil
-- Find the base, one removed from the last prop
......@@ -651,7 +652,7 @@ function _M:removeTemporaryValue(prop, id, noupdate)
recursive(base[prop], k, e, method)
end
else
error("unsupported temporary value type: "..type(v).." :=: "..v)
error("unsupported temporary value type: "..type(v).." :=: "..tostring(v))
end
end
......
......@@ -922,6 +922,7 @@ dir_sides =
[2] = {left=3, right=1},
[3] = {left=6, right=2},
[4] = {left=1, right=7},
[5] = {left=7, right=9}, -- To avoid problems
[6] = {left=9, right=3},
[7] = {left=4, right=8},
[8] = {left=7, right=9},
......
......@@ -1079,9 +1079,9 @@ function _M:setupCommands()
end end,
[{"_f","ctrl"}] = function() if config.settings.cheat then
self.player:setEffect(self.player.EFF_SPEED, 20, {power=2})
self.player:setEffect(self.player.EFF_SLOW, 20, {power=0.3})
self.player:setEffect(self.player.EFF_INVIGORATED, 20, {power=30})
self.player.quests["love-melinda"] = nil
self.player:grantQuest("love-melinda")
self.player:hasQuest("love-melinda"):melindaWarrior(self.player)
end end,
}
......
......@@ -683,14 +683,14 @@ function _M:playerPickup()
local titleupdator = self:getEncumberTitleUpdator("Pickup")
local d d = self:showPickupFloor(titleupdator(), nil, function(o, item)
local o = self:pickupFloor(item, true)
if o then o.__new_pickup = true end
if o and type(o) == "table" then o.__new_pickup = true end
self.changed = true
d:updateTitle(titleupdator())
d:used()
end)
else
local o = self:pickupFloor(1, true)
if o then o.__new_pickup = true end
if o and type(o) == "table" then o.__new_pickup = true end
self:sortInven()
self:useEnergy()
self.changed = true
......
......@@ -42,7 +42,7 @@ end
function spawnFortress(self, who) game:onTickEnd(function()
local melinda = require("mod.class.NPC").new{
name = "Melinda",
name = "Melinda", define_as = "MELINDA_NPC",
type = "humanoid", subtype = "human", female=true,
display = "@", color=colors.LIGHT_BLUE,
image = "player/cornac_female_redhair.png",
......@@ -78,3 +78,33 @@ function spawnFortress(self, who) game:onTickEnd(function()
who:setQuestStatus(self.id, self.COMPLETED, "moved-in")
end) end
function melindaWarrior(self, who)
for uid, e in pairs(game.level.entities) do if e.define_as == "MELINDA_NPC" then e:disappear() end end
local melinda = require("mod.class.Player").new{name="Melinda"}
local birth = require("mod.dialogs.Birther").new("", melinda, {}, function() end)
birth:setDescriptor("sex", "Female")
birth:setDescriptor("world", "Maj'Eyal")
birth:setDescriptor("difficulty", "Normal")
birth:setDescriptor("permadeath", "Roguelike")
birth:setDescriptor("race", "Human")
birth:setDescriptor("subrace", "Cornac")
birth:setDescriptor("class", "Warrior")
birth:setDescriptor("subclass", "Fighter")
birth.actor = melinda
birth:apply()
melinda.image = "player/cornac_female_redhair.png"
melinda.moddable_tile_base = "base_redhead_01.png"
melinda:resolve() melinda:resolve(nil, true)
melinda:removeAllMOs()
local spot = game.level:pickSpot{type="spawn", subtype="melinda"}
game.zone:addEntity(game.level, melinda, "actor", spot.x, spot.y)
melinda:forceLevelup(who.level)
game.party:addMember(melinda, {
control="full", type="companion", title="Melina",
orders = {target=true, leash=true, anchor=true, talents=true, behavior=true},
})
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