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

plop

git-svn-id: http://svn.net-core.org/repos/t-engine4@6703 51575b47-30f0-44d4-a5cc-537603b46e54
parent e52de219
No related branches found
No related tags found
No related merge requests found
......@@ -81,14 +81,25 @@ function _M:updateBaseLevel()
end
end
function _M:getBaseName()
local name = self.short_name
local base = "/data"
local _, _, addon, rname = name:find("^([^+]+)%+(.+)$")
if addon and rname then
base = "/data-"..addon
name = rname
end
return base.."/zones/"..name.."/"
end
--- Loads basic entities lists
local _load_zone = nil
function _M:loadBaseLists()
_load_zone = self
self.npc_list = self.npc_class:loadList("/data/zones/"..self.short_name.."/npcs.lua")
self.grid_list = self.grid_class:loadList("/data/zones/"..self.short_name.."/grids.lua")
self.object_list = self.object_class:loadList("/data/zones/"..self.short_name.."/objects.lua")
self.trap_list = self.trap_class:loadList("/data/zones/"..self.short_name.."/traps.lua")
self.npc_list = self.npc_class:loadList(self:getBaseName().."npcs.lua")
self.grid_list = self.grid_class:loadList(self:getBaseName().."grids.lua")
self.object_list = self.object_class:loadList(self:getBaseName().."objects.lua")
self.trap_list = self.trap_class:loadList(self:getBaseName().."traps.lua")
_load_zone = nil
end
......@@ -588,7 +599,7 @@ function _M:load(dynamic)
local data = savefile_pipe:doLoad(game.save_name, "zone", nil, self.short_name)
if not data and not dynamic then
local f, err = loadfile("/data/zones/"..self.short_name.."/zone.lua")
local f, err = loadfile(self:getBaseName().."zone.lua")
if err then error(err) end
setfenv(f, setmetatable({self=self, short_name=self.short_name}, {__index=_G}))
data = f()
......@@ -603,7 +614,7 @@ function _M:load(dynamic)
end
for k, e in pairs(data) do self[k] = e end
self:onLoadZoneFile("/data/zones/"..self.short_name.."/")
self:onLoadZoneFile(self:getBaseName())
if self.on_loaded then self:on_loaded() end
elseif not data and dynamic then
data = dynamic
......
......@@ -18,7 +18,7 @@
-- darkgod@te4.org
-- Engine Version
engine.version = {1,0,3,"te4",17}
engine.version = {1,0,4,"te4",17}
engine.require_c_core = engine.version[5]
engine.version_id = ("%s-%d_%d.%d.%d"):format(engine.version[4], engine.require_c_core, engine.version[1], engine.version[2], engine.version[3])
......
......@@ -22,8 +22,8 @@ long_name = "Example Module for T-Engine4"
short_name = "example"
author = { "DarkGod", "darkgod@te4.org" }
homepage = "http://te4.org/modules:example"
version = {1,0,3}
engine = {1,0,3,"te4"}
version = {1,0,4}
engine = {1,0,4,"te4"}
description = [[
This is *NOT* a game, just an example/template to make your own using the T-Engine4.
]]
......
......@@ -22,8 +22,8 @@ long_name = "Realtime Example Module for T-Engine4"
short_name = "example_realtime"
author = { "DarkGod", "darkgod@te4.org" }
homepage = "http://te4.org/modules:example"
version = {1,0,3}
engine = {1,0,3,"te4"}
version = {1,0,4}
engine = {1,0,4,"te4"}
description = [[
This is *NOT* a game, just an example/template to make your own using the T-Engine4.
]]
......
......@@ -62,6 +62,9 @@ function _M:archeryAcquireTargets(tg, params)
if offweapon then wtravel_speed = math.ceil(((weapon.travel_speed or 0) + (offweapon.travel_speed or 0)) / 2) end
tg.speed = (tg.speed or 10) + (ammo.combat.travel_speed or 0) + (wtravel_speed or 0) + (self.travel_speed or 0)
print("[PROJECTILE SPEED] ::", tg.speed)
self:triggerHook{"Combat:archeryTargetKind", tg=tg, params=params, mode="target"}
local x, y = params.x, params.y
if not x or not y then x, y = self:getTarget(tg) end
if not x or not y then return nil end
......@@ -174,16 +177,16 @@ local function archery_projectile(tx, ty, tg, self, tmp)
-- Does the blow connect? yes .. complex :/
if tg.archery.use_psi_archery then self.use_psi_combat = true end
local atk, def = self:combatAttackRanged(weapon, ammo), target:combatDefenseRanged()
local dam, apr, armor = self:combatDamage(ammo), self:combatAPR(ammo), target:combatArmor()
local dam, apr, armor = self:combatDamage(ammo), self:combatAPR(ammo) + (weapon and weapon.apr or 0), target:combatArmor()
atk = atk + (tg.archery.atk or 0)
dam = dam + (tg.archery.dam or 0)
apr = apr + (tg.archery.apr or 0)
print("[ATTACK ARCHERY] to ", target.name, " :: ", dam, apr, armor, "::", mult)
-- If hit is over 0 it connects, if it is 0 we still have 50% chance
local hitted = false
local crit = false
if self:checkHit(atk, def) and (self:canSee(target) or self:attr("blind_fight") or rng.chance(3)) then
apr = apr + (tg.archery.apr or 0)
print("[ATTACK ARCHERY] raw dam", dam, "versus", armor, "with APR", apr)
local pres = util.bound(target:combatArmorHardiness() / 100, 0, 1)
......@@ -487,6 +490,9 @@ function _M:archeryShoot(targets, talent, tg, params)
tg.type = tg.type or weapon.tg_type or ammo.combat.tg_type or tg.type or "bolt"
tg.talent = tg.talent or talent
params = params or {}
self:triggerHook{"Combat:archeryTargetKind", tg=tg, params=params, mode="fire"}
local dofire = function(weapon, targets)
if not tg.range then tg.range=weapon.range or 6 end
tg.display = tg.display or self:archeryDefaultProjectileVisual(realweapon, ammo)
......@@ -504,7 +510,7 @@ function _M:archeryShoot(targets, talent, tg, params)
dofire(weapon, targets)
elseif offweapon and targets.dual then
dofire(weapon, targets.main)
dofire(offweapon, targets.off)
dofire(offweapon.combat, targets.off)
else
print("[SHOOT] error, mismatch between dual weapon/dual targets")
end
......
game/modules/tome/data/gfx/shockbolt/npc/humanoid_human_the_possessed.png

10.3 KiB | W: | H:

game/modules/tome/data/gfx/shockbolt/npc/humanoid_human_the_possessed.png

13.8 KiB | W: | H:

game/modules/tome/data/gfx/shockbolt/npc/humanoid_human_the_possessed.png
game/modules/tome/data/gfx/shockbolt/npc/humanoid_human_the_possessed.png
game/modules/tome/data/gfx/shockbolt/npc/humanoid_human_the_possessed.png
game/modules/tome/data/gfx/shockbolt/npc/humanoid_human_the_possessed.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -37,7 +37,7 @@ newEntity{
nice_editer = cracks_editer,
block_move = function(self, x, y, who, act)
if not who or not act or not who.player then return true end
require("engine.ui.Dialog"):yesnoLongPopup("Crack in the floor", "This area seems to have been hit by a huge tremor, breaking the floor in a huge crack.\nYou think you can jump to the level bellow.", 400, function(ret) if ret then
require("engine.ui.Dialog"):yesnoLongPopup("Crack in the floor", "This area appears to have been hit by a huge tremor, breaking the floor in a huge crack.\nYou think you can jump to the level below.", 400, function(ret) if ret then
game:changeLevel(game.level.level + 1)
end end, "Jump", "Stay")
return true
......
......@@ -50,7 +50,7 @@ newEntity{ define_as = "HORNED_HORROR",
name = "Horned Horror",
display = "h", color=colors.VIOLET,
resolvers.nice_tile{image="invis.png", add_mos = {{image="npc/horror_corrupted_horner_horror.png", display_h=2, display_y=-1}}},
desc = [[A fearsome bull-headed monster, he swings a mighty axe as he curses all that defy him.]],
desc = [[Some horrible power has twisted this brutish minotaur into something altogether more terrifying. Huge tentacles undulate from its back as it clenches and unclenches its powerful fists.]],
killer_message = "and revived as a mindless horror",
level_range = {12, nil}, exp_worth = 2,
max_life = 250, life_rating = 17, fixed_rating = true,
......@@ -101,7 +101,7 @@ newEntity{ define_as = "MINOTAUR_MAZE",
name = "Minotaur of the Labyrinth",
display = "H", color=colors.VIOLET,
resolvers.nice_tile{image="invis.png", add_mos = {{image="npc/giant_minotaur_minotaur_of_the_labyrinth.png", display_h=2, display_y=-1}}},
desc = [[A fearsome bull-headed monster, he swings a mighty axe as he curses all that defy him.]],
desc = [[A fearsome bull-headed monster, he swings a mighty axe as he curses all who defy him.]],
killer_message = "and hung on a wall-spike",
level_range = {12, nil}, exp_worth = 2,
max_life = 250, life_rating = 17, fixed_rating = true,
......
......@@ -85,6 +85,7 @@ newEntity{ define_as = "SHADE",
newEntity{ base = "BASE_NPC_THIEF", define_as = "THE_POSSESSED",
allow_infinite_dungeon = true,
name = "The Possessed", color=colors.VIOLET,
resolvers.nice_tile{image="invis.png", add_mos = {{image="npc/humanoid_human_the_possessed.png", display_h=2, display_y=-1}}},
desc = [[He is the leader of a gang of bandits that killed the Shade of Kor'Pul, however it is obvious the Shade was merely displaced. It is now possessing the corpse of his killer.]],
killer_message = "and used as a new host",
level_range = {7, nil}, exp_worth = 2,
......
......@@ -22,8 +22,8 @@ long_name = "Tales of Maj'Eyal: Age of Ascendancy"
short_name = "tome"
author = { "DarkGod", "darkgod@te4.org" }
homepage = "http://te4.org/"
version = {1,0,3}
engine = {1,0,3,"te4"}
version = {1,0,4}
engine = {1,0,4,"te4"}
description = [[
Welcome to Maj'Eyal.
......
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