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

Arrows & Shots projectiles now have a correct tile

git-svn-id: http://svn.net-core.org/repos/t-engine4@3767 51575b47-30f0-44d4-a5cc-537603b46e54
parent b553ef54
No related branches found
No related tags found
No related merge requests found
Showing
with 69 additions and 13 deletions
......@@ -63,7 +63,16 @@ function _M:move(x, y, force)
map(x, y, Map.PROJECTILE, self)
if self.travel_particle then
self:addParticles(Particles.new(self.travel_particle, 1, nil))
if self.project then
local args = table.clone(self.travel_particle_args or {})
args.src_x = self.old_x
args.src_y = self.old_y
args.proj_x = self.project.def.x
args.proj_y = self.project.def.y
self:addParticles(Particles.new(self.travel_particle, 1, args))
else
self:addParticles(Particles.new(self.travel_particle, 1, self.travel_particle_args))
end
self.travel_particle = nil
end
if self.trail_particle then
......@@ -232,6 +241,7 @@ function _M:makeProject(src, display, def, do_move, do_act, do_stop)
name = name,
display = display.display or ' ', color = display.color or colors.WHITE, image = display.image or nil,
travel_particle = display.particle,
travel_particle_args = display.particle_args,
trail_particle = display.trail,
src = src,
src_x = src.x, src_y = src.y,
......@@ -255,6 +265,7 @@ function _M:makeHoming(src, display, def, target, count, on_move, on_hit)
name = name,
display = display.display or ' ', color = display.color or colors.WHITE, image = display.image or nil,
travel_particle = display.particle,
travel_particle_args = display.particle_args,
trail_particle = display.trail,
src = src,
def = def,
......
......@@ -1098,6 +1098,12 @@ function _M:onTakeHit(value, src)
end
end
if self:hasEffect(self.EFF_BONE_SHIELD) then
local e = self.tempeffect_def[self.EFF_BONE_SHIELD]
e.absorb(self, self.tmp[self.EFF_BONE_SHIELD])
value = 0
end
if self:isTalentActive(self.T_BONE_SHIELD) then
local t = self:getTalentFromId(self.T_BONE_SHIELD)
t.absorb(self, t, self:isTalentActive(self.T_BONE_SHIELD))
......
......@@ -971,15 +971,7 @@ function _M:setupCommands()
--]]
end end,
[{"_g","ctrl"}] = function() if config.settings.cheat then
game.player:learnLore("shertul-fortress-9")
game.player:learnLore("shertul-fortress-8")
game.player:learnLore("shertul-fortress-7")
game.player:learnLore("shertul-fortress-6")
game.player:learnLore("shertul-fortress-5")
game.player:learnLore("shertul-fortress-4")
game.player:learnLore("shertul-fortress-3")
game.player:learnLore("shertul-fortress-2")
game.player:learnLore("shertul-fortress-1")
game.player:setEffect(game.player.EFF_BONE_SHIELD, 30, {nb=3})
-- self.state:debugRandomZone()
-- local m = game.zone:makeEntity(game.level, "actor", {random_boss=true}, nil, true)
-- if m then game.zone:addEntity(game.level, m, "actor", game.player.x, game.player.y + 1) end
......
......@@ -213,7 +213,7 @@ function _M:archeryShoot(targets, talent, tg, params)
tg.talent = tg.talent or talent
if not tg.range then tg.range=weapon.range or 6 end
tg.display = tg.display or {display='/', trail="generictrail"}
tg.display = tg.display or {display=' ', particle="arrow", particle_args={tile="shockbolt/"..(ammo.proj_image or realweapon.proj_image):gsub("%.png$", "")}}
tg.speed = (tg.speed or 20) * (ammo.travel_speed or 100) / 100
tg.archery = params or {}
tg.archery.weapon = weapon
......
......@@ -28,7 +28,8 @@ newEntity{
rarity = 5,
combat = { talented = "bow", sound = "actions/arrow", sound_miss = "actions/arrow",},
archery = "bow",
basic_ammo = { talented = "bow", damrange = 1.4},
proj_image = resolvers.image_material("arrow", "wood"),
basic_ammo = { talented = "bow", damrange = 1.4 },
desc = [[Longbows are used to shoot arrows at your foes.]],
randart_able = { attack=40, physical=80, spell=20, def=10, misc=10 },
egos = "/data/general/objects/egos/bow.lua", egos_chance = { prefix=resolvers.mbonus(40, 5), suffix=resolvers.mbonus(40, 5) },
......@@ -135,6 +136,7 @@ newEntity{
encumber = 0.03,
rarity = 11,
combat = { talented = "bow", damrange = 1.4},
proj_image = resolvers.image_material("arrow", "wood"),
archery_ammo = "bow",
desc = [[Arrows are used with bows to pierce your foes to death.]],
generate_stack = resolvers.rngavg(100,200),
......
......@@ -27,6 +27,7 @@ newEntity{
rarity = 5,
combat = { talented = "sling", sound = "actions/arrow", sound_miss = "actions/arrow", },
archery = "sling",
proj_image = resolvers.image_material("shot_s", "metal"),
basic_ammo = { talented = "sling", damrange = 1.2},
desc = [[Slings are used to hurl stones or metal shots at your foes.]],
randart_able = { attack=40, physical=80, spell=20, def=10, misc=10 },
......@@ -134,6 +135,7 @@ newEntity{
encumber = 0.03,
rarity = 11,
combat = { talented = "sling", damrange = 1.2},
proj_image = resolvers.image_material("shot_s", "metal"),
archery_ammo = "sling",
desc = [[Shots are used with slings to pummel your foes to death.]],
generate_stack = resolvers.rngavg(100,200),
......
game/modules/tome/data/gfx/lore/fortress_takeoff.png

458 KiB

game/modules/tome/data/gfx/shockbolt/object/shot_s_dsteel.png

4.75 KiB

game/modules/tome/data/gfx/shockbolt/object/shot_s_iron.png

4.56 KiB

game/modules/tome/data/gfx/shockbolt/object/shot_s_steel.png

4.06 KiB

game/modules/tome/data/gfx/shockbolt/object/shot_s_stralite.png

4.52 KiB

game/modules/tome/data/gfx/shockbolt/object/shot_s_voratun.png

5.21 KiB

game/modules/tome/data/gfx/shockbolt/terrain/shertul_flying_castle.png

13.1 KiB

......@@ -45,6 +45,13 @@ desc = function(self, who)
desc[#desc+1] = "The fortress shadow has asked that you come back as soon as possible."
end
end
if self:isCompleted("flight") then
if self:isCompleted("flight-done") then
desc[#desc+1] = "You have re-enabled the Fortress flight systems, you can now fly around in your fortress!"
else
desc[#desc+1] = "The fortress shadow has asked that you find an Ancient Storm Saphir, along with at least 250 energy, to re-enable the Fortress flight systems."
end
end
if self.shertul_energy > 0 then
desc[#desc+1] = ("The Fortress current energy level is: %d."):format(self.shertul_energy)
end
......@@ -89,6 +96,12 @@ gain_energy = function(self, energy)
local Dialog = require "engine.ui.Dialog"
Dialog:simpleLongPopup("Fortress Shadow", "Master, you have sent enough energy to activate the exploratory farportal.\nHowever there seems to be a disturbance in that room, please return as soon as possible.", 400)
end
if self.shertul_energy >= 250 and not self:isCompleted("flight") then
game.player:setQuestStatus(self.id, self.COMPLETED, "flight")
local Dialog = require "engine.ui.Dialog"
Dialog:simpleLongPopup("Fortress Shadow", "Master, you have sent enough energy to activate the flight systems.\nHowever one control crystal is broken, you need to find a #GOLD#Ancient Storm Saphir#WHITE#.", 400)
end
end
exploratory_energy = function(self, check_only)
......
......@@ -185,7 +185,9 @@ newTalent{
return true
end,
info = function(self, t)
return ([[]]):
return ([[
bone shield ?
]]):
format()
end,
}
......
......@@ -4127,3 +4127,31 @@ newEffect{
self:removeTemporaryValue("combat_spellcrit", eff.scritid)
end,
}
newEffect{
name = "BONE_SHIELD",
desc = "Bone Shield",
long_desc = function(self, eff) return ("Fully protects from %d damaging actions."):format(#eff.particles) end,
type = "magical",
status = "beneficial",
parameters = { nb=3 },
on_gain = function(self, err) return "#Target# protected by flying bones.", "+Bone Shield" end,
on_lose = function(self, err) return "#Target# flying bones crumble.", "-Bone Shield" end,
absorb = function(self, eff)
game.logPlayer(self, "Your bone shield absorbs the damage!")
local pid = table.remove(eff.particles)
if pid then self:removeParticles(pid) end
if #eff.particles <= 0 then
eff.dur = 0
end
end,
activate = function(self, eff)
local nb = eff.nb
local ps = {}
for i = 1, nb do ps[#ps+1] = self:addParticles(Particles.new("bone_shield", 1)) end
eff.particles = ps
end,
deactivate = function(self, eff)
for i, particle in ipairs(eff.particles) do self:removeParticles(particle) 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