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

code typos

git-svn-id: http://svn.net-core.org/repos/t-engine4@2261 51575b47-30f0-44d4-a5cc-537603b46e54
parent 0476bbb0
No related branches found
No related tags found
No related merge requests found
Showing
with 49 additions and 49 deletions
......@@ -276,7 +276,7 @@ _F15 = 296
-- Key state modifier keys
_NUMLOCK = 300
_CAPSLOCK = 301
_SCROLLOCK = 302
_SCROLLLOCK = 302
_RSHIFT = 303
_LSHIFT = 304
_RCTRL = 305
......
......@@ -154,7 +154,7 @@ end
--- Loads a locale converter
-- WARNING: This only converts the "sym" key, *NOT* the unicode key
-- @param file the locale conversion file to load
function _M:loadLocaleConvertion(file)
function _M:loadLocaleConversion(file)
local f, err = loadfile(file)
if not f and err then error(err) end
setfenv(f, setmetatable({
......
......@@ -62,9 +62,9 @@ function _M:backSpace()
--[[
if (self.cursorPosition==0) then return end
local temptext = self.text:sub(1, self.cursorPosition - 1)
if self.cursorPosition < self.maximumCurosrPosition then temptext = temptext..self.text:sub(self.cursorPosition + 1, self.text:len()) end
if self.cursorPosition < self.maximumCursorPosition then temptext = temptext..self.text:sub(self.cursorPosition + 1, self.text:len()) end
self.text = temptext
self.maximumCurosrPosition = self.maximumCurosrPosition - 1
self.maximumCursorPosition = self.maximumCursorPosition - 1
self.cursorPosition = self.cursorPosition - 1
]]
local b = tostring(self.text)
......@@ -91,7 +91,7 @@ function _M:textInput(c)
--[[
if self.text:len() < self.max then
local temp=nil
if self.cursorPosition < self.maximumCurosrPosition then temp=self.text:sub(self.cursorPosition + 1, self.text:len()) end
if self.cursorPosition < self.maximumCursorPosition then temp=self.text:sub(self.cursorPosition + 1, self.text:len()) end
self.text = self.text:sub(1,self.cursorPosition) .. c
if temp then self.text=self.text..temp end
self.owner.changed = true
......
......@@ -57,26 +57,26 @@ function _M:init(dialogdef, owner, font, mask, fct)
end
function _M:delete()
if (self.cursorPosition>=self.maximumCurosrPosition) then return end
if (self.cursorPosition>=self.maximumCursorPosition) then return end
local temptext = self.text:sub(1, self.cursorPosition)
if self.cursorPosition < self.maximumCurosrPosition - 1 then temptext = temptext..self.text:sub(self.cursorPosition + 2, self.text:len()) end
if self.cursorPosition < self.maximumCursorPosition - 1 then temptext = temptext..self.text:sub(self.cursorPosition + 2, self.text:len()) end
self.text = temptext
self.maximumCurosrPosition = self.maximumCurosrPosition - 1
self.maximumCursorPosition = self.maximumCursorPosition - 1
end
function _M:backSpace()
if (self.cursorPosition==0) then return end
local temptext = self.text:sub(1, self.cursorPosition - 1)
if self.cursorPosition < self.maximumCurosrPosition then temptext = temptext..self.text:sub(self.cursorPosition + 1, self.text:len()) end
if self.cursorPosition < self.maximumCursorPosition then temptext = temptext..self.text:sub(self.cursorPosition + 1, self.text:len()) end
self.text = temptext
self.maximumCurosrPosition = self.maximumCurosrPosition - 1
self.maximumCursorPosition = self.maximumCursorPosition - 1
self.cursorPosition = self.cursorPosition - 1
end
function _M:textInput(c)
if self.text:len() < self.max then
local temp=nil
if self.cursorPosition < self.maximumCurosrPosition then temp=self.text:sub(self.cursorPosition + 1, self.text:len()) end
if self.cursorPosition < self.maximumCursorPosition then temp=self.text:sub(self.cursorPosition + 1, self.text:len()) end
self.text = self.text:sub(1,self.cursorPosition) .. c
if temp then self.text=self.text..temp end
self.owner.changed = true
......
......@@ -77,9 +77,9 @@ function _M:init(short_name, dynamic)
end
--- Leaves a zone
-- Saves the zone to a .teaz file if requested with persistant="zone" flag
-- Saves the zone to a .teaz file if requested with persistent="zone" flag
function _M:leave()
if type(self.persistant) == "string" and self.persistant == "zone" then
if type(self.persistent) == "string" and self.persistent == "zone" then
savefile_pipe:push(game.save_name, "zone", self)
-- local save = Savefile.new(game.save_name)
-- save:saveZone(self)
......@@ -463,15 +463,15 @@ function _M:leaveLevel(no_close, lev, old_lev)
if not no_close and game.level and game.level.map then
game:leaveLevel(game.level, lev, old_lev)
if type(game.level.data.persistant) == "string" and game.level.data.persistant == "zone" and not self.save_per_level then
if type(game.level.data.persistent) == "string" and game.level.data.persistent == "zone" and not self.save_per_level then
print("[LEVEL] persisting to zone memory", game.level.id)
self.memory_levels = self.memory_levels or {}
self.memory_levels[game.level.level] = game.level
elseif type(game.level.data.persistant) == "string" and game.level.data.persistant == "memory" then
elseif type(game.level.data.persistent) == "string" and game.level.data.persistent == "memory" then
print("[LEVEL] persisting to memory", game.level.id)
game.memory_levels = game.memory_levels or {}
game.memory_levels[game.level.id] = game.level
elseif game.level.data.persistant then
elseif game.level.data.persistent then
print("[LEVEL] persisting to disk file", game.level.id)
savefile_pipe:push(game.save_name, "level", game.level)
else
......@@ -491,8 +491,8 @@ function _M:getLevel(game, lev, old_lev, no_close)
local level_data = self:getLevelData(lev)
local level
-- Load persistant level?
if type(level_data.persistant) == "string" and level_data.persistant == "zone" and not self.save_per_level then
-- Load persistent level?
if type(level_data.persistent) == "string" and level_data.persistent == "zone" and not self.save_per_level then
self.memory_levels = self.memory_levels or {}
level = self.memory_levels[lev]
......@@ -503,7 +503,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
-- This is not needed in case of a direct to file persistance becuase the map IS recreated each time anyway
level.map:recreate()
end
elseif type(level_data.persistant) == "string" and level_data.persistant == "memory" then
elseif type(level_data.persistent) == "string" and level_data.persistent == "memory" then
game.memory_levels = game.memory_levels or {}
level = game.memory_levels[self.short_name.."-"..lev]
......@@ -514,7 +514,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
-- This is not needed in case of a direct to file persistance becuase the map IS recreated each time anyway
level.map:recreate()
end
elseif level_data.persistant then
elseif level_data.persistent then
-- Try to load from a savefile
level = savefile_pipe:doLoad(game.save_name, "level", nil, self.short_name, lev)
......
......@@ -84,7 +84,7 @@ function _M:loadTiles(tileset)
if ts.define_as then tiles[ts.define_as] = t end
-- X symmetric tile definition
if ts.base and ts.symetric and ts.symetric == "x" then
if ts.base and ts.symmetric and ts.symmetric == "x" then
local ts = tiles[ts.base]
local mx, my = #ts, #ts[1]
for j = 1, my do for ri = 1, mx do
......@@ -96,7 +96,7 @@ function _M:loadTiles(tileset)
t.sizew, t.sizeh = mx / d.base.w, my / d.base.h
-- Y symmetric tile definition
elseif ts.base and ts.symetric and ts.symetric == "y" then
elseif ts.base and ts.symmetric and ts.symmetric == "y" then
local ts = tiles[ts.base]
local mx, my = #ts, #ts[1]
for rj = 1, my do for i = 1, mx do
......
......@@ -203,12 +203,12 @@ end
--- Returns how many talents of this type the actor knows
-- @param type the talent type to count
-- @param exlude_id if not nil the count will ignore this talent id
function _M:numberKnownTalent(type, exlude_id)
-- @param exclude_id if not nil the count will ignore this talent id
function _M:numberKnownTalent(type, exclude_id)
local nb = 0
for id, _ in pairs(self.talents) do
local t = _M.talents_def[id]
if t.type[1] == type and (not exlude_id or exlude_id ~= id) then nb = nb + 1 end
if t.type[1] == type and (not exclude_id or exclude_id ~= id) then nb = nb + 1 end
end
return nb
end
......
......@@ -30,13 +30,13 @@ module(..., package.seeall, class.make)
function _M:startCursor()
self.cursorPosition = 0
self.maximumCurosrPosition = 0
self.maximumCursorPosition = 0
self.focused = false
end
function _M:moveRight(x, add)
if add and self.cursorPosition + x > self.maximumCurosrPosition then self.maximumCurosrPosition = self.cursorPosition + x end
if self.cursorPosition + x <= self.maximumCurosrPosition then
if add and self.cursorPosition + x > self.maximumCursorPosition then self.maximumCursorPosition = self.cursorPosition + x end
if self.cursorPosition + x <= self.maximumCursorPosition then
self.cursorPosition = self.cursorPosition + x
end
end
......
......@@ -23,7 +23,7 @@ return {
max_level = 10,
decay = {300, 800},
width = 50, height = 50,
persistant = "zone",
persistent = "zone",
generator = {
map = {
class = "engine.generator.map.Roomer",
......
......@@ -81,7 +81,7 @@ function _M:cleanActor()
end
--- Restore resources
function _M:restoreRessources()
function _M:restoreResources()
self.actor.life = self.actor.max_life
self.actor.power = self.actor.max_power
......@@ -116,7 +116,7 @@ function _M:use(item)
game.logPlayer(self.actor, "#LIGHT_BLUE#You resurrect! CHEATER !")
self:cleanActor()
self:restoreRessources()
self:restoreResources()
self:resurrectBasic()
end
end
......
......@@ -23,7 +23,7 @@ return {
max_level = 10,
decay = {300, 800},
width = 50, height = 50,
persistant = "zone",
persistent = "zone",
generator = {
map = {
class = "engine.generator.map.Roomer",
......
......@@ -81,7 +81,7 @@ function _M:cleanActor()
end
--- Restore resources
function _M:restoreRessources()
function _M:restoreResources()
self.actor.life = self.actor.max_life
self.actor.power = self.actor.max_power
......@@ -116,7 +116,7 @@ function _M:use(item)
game.logPlayer(self.actor, "#LIGHT_BLUE#You resurrect! CHEATER !")
self:cleanActor()
self:restoreRessources()
self:restoreResources()
self:resurrectBasic()
end
end
......
......@@ -73,7 +73,7 @@ function _M:init()
engine.interface.GameMusic.init(self)
engine.interface.GameSound.init(self)
self.persistant_actors = {}
self.persistent_actors = {}
-- Pause at birth
self.paused = true
......@@ -353,7 +353,7 @@ function _M:setupMiniMap()
end
function _M:save()
return class.save(self, self:defaultSavedFields{difficulty=true, persistant_actors=true, to_re_add_actors=true}, true)
return class.save(self, self:defaultSavedFields{difficulty=true, persistent_actors=true, to_re_add_actors=true}, true)
end
function _M:getSaveDescription()
......@@ -386,7 +386,7 @@ function _M:leaveLevel(level, lev, old_lev)
level.exited.up = {x=self.player.x, y=self.player.y}
end
level.last_turn = self.turn
for act, _ in pairs(self.persistant_actors) do
for act, _ in pairs(self.persistent_actors) do
if level:hasEntity(act) then
level:removeEntity(act)
self.to_re_add_actors[act] = true
......@@ -503,9 +503,9 @@ function _M:changeLevel(lev, zone, keep_old_lev, force_down)
self.player:onEnterLevel(self.zone, self.level)
if self.level.data.ambiant_music then
if self.level.data.ambiant_music ~= "last" then
self:playMusic(self.level.data.ambiant_music)
if self.level.data.ambient_music then
if self.level.data.ambient_music ~= "last" then
self:playMusic(self.level.data.ambient_music)
end
else
self:stopMusic()
......
......@@ -347,7 +347,7 @@ function _M:spawnWorldAmbush(enc)
actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end,
width = enc.width or 20, height = enc.height or 20,
all_lited = true,
ambiant_music = "last",
ambient_music = "last",
generator = {
map = gen,
actor = { class = "engine.generator.actor.Random", nb_npc = enc.nb or {1,1}, filters=enc.filters },
......
......@@ -35,12 +35,12 @@ function _M:generate(lev, old_lev)
local ln = 0
local path = core.noise.new(1)
local widness = core.noise.new(1)
local wideness = core.noise.new(1)
local i = self.data.start
local dir = true
for j = 0, self.map.h - 1 do
local wd = widness:fbm_perlin(20 * j / self.map.h, 4)
local wd = wideness:fbm_perlin(20 * j / self.map.h, 4)
wd = math.ceil(((wd + 1) / 2) * 4)
for ii = i - wd, i + wd do if self.map:isBound(ii, j) then self.map(ii, j, Map.TERRAIN, self:resolve(".")) end end
......
......@@ -70,7 +70,7 @@ function _M:generate(lev, old_lev)
self:makePath(sp.x, sp.y, ep.x, ep.y, 0, 0.25, points)
end
-- Place pedestrals
-- Place pedestals
local orbs = {"ORB_UNDEATH", "ORB_DRAGON", "ORB_ELEMENTS", "ORB_DESTRUCTION"}
for i = 1, 4 do
local orb = rng.tableRemove(orbs)
......
......@@ -62,7 +62,7 @@ newEntity{
actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end,
width = 30, height = 30,
no_worldport = true,
ambiant_music = "a_lomos_del_dragon_blanco.ogg",
ambient_music = "a_lomos_del_dragon_blanco.ogg",
generator = {
map = {
class = "engine.generator.map.TileSet",
......
......@@ -89,7 +89,7 @@ newTalent{
action = function(self, t)
if not self.alchemy_golem then
self.alchemy_golem = game.zone:finishEntity(game.level, "actor", makeGolem())
game.persistant_actors[self.alchemy_golem] = 1
game.persistent_actors[self.alchemy_golem] = 1
if not self.alchemy_golem then return end
self.alchemy_golem.faction = self.faction
self.alchemy_golem.name = "golem (servant of "..self.name..")"
......
......@@ -94,7 +94,7 @@ tiles =
[[###.....##]],
[[#######'##]],
},
{type="room", base="BIG_CRYPT", symetric="x"},
{type="room", base="BIG_CRYPT", symmetric="x"},
{type="room", base="BIG_CRYPT", rotation="90"},
{type="room", base="BIG_CRYPT", rotation="270"},
......
......@@ -27,8 +27,8 @@ return {
width = 30, height = 30,
-- all_remembered = true,
-- all_lited = true,
persistant = "zone",
ambiant_music = "Anne_van_Schothorst_-_Passed_Tense.ogg",
persistent = "zone",
ambient_music = "Anne_van_Schothorst_-_Passed_Tense.ogg",
generator = {
map = {
class = "engine.generator.map.TileSet",
......
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