[NEW] Moguts els dialegs a trigger per event
This commit is contained in:
@@ -4,12 +4,17 @@ trigger_event = {
|
||||
|
||||
trigger_ev = {}
|
||||
|
||||
function trigger_event.new ( _name, _tr_func, _tr_init, _tr_update )
|
||||
function trigger_event.new ( _name, _tr_func, _tr_init, _tr_update, _a, _b, _time, _text, _distancia )
|
||||
table.insert( trigger_event.list, {
|
||||
name = _name,
|
||||
trigger = _tr_func,
|
||||
init = _tr_init,
|
||||
update = _tr_update,
|
||||
actor = _a,
|
||||
actor_b = _b,
|
||||
time = _time,
|
||||
text = _text,
|
||||
distancia = _distancia,
|
||||
enabled = true,
|
||||
running = false,
|
||||
})
|
||||
@@ -81,14 +86,14 @@ function trigger_ev:premiere_healer_update()
|
||||
local hab, tx, ty = coords.world_to_tile(premiere.x, premiere.y)
|
||||
if hab == 55 and tx==0 and ty==3 and premiere.health_wait==100 then
|
||||
-- 55 (0,3)
|
||||
local _text = "Tenne! Io t'achudo. Figo!";
|
||||
table.insert(
|
||||
dialegs,
|
||||
{ actor1=premiere,
|
||||
actor2=abad,
|
||||
distancia=500,
|
||||
direccio = "",
|
||||
enabled=true,
|
||||
text="Tenne! Io t'achudo. Figo!"
|
||||
dialeg.list,
|
||||
{ actor=premiere,
|
||||
text=_text,
|
||||
time=200,
|
||||
w = math.floor(4.6*#_text),
|
||||
h = 20,
|
||||
}
|
||||
)
|
||||
premiere.health_wait = premiere.health_wait - 1
|
||||
@@ -101,11 +106,26 @@ function trigger_ev:premiere_healer_update()
|
||||
end
|
||||
end
|
||||
|
||||
function premiere_dialeg1_trigger ()
|
||||
if h_collision( premiere, abad) and
|
||||
distancia ( premiere, abad )<=150
|
||||
-- DIALEG GENERAL
|
||||
function trigger_ev:dialeg_trigger ()
|
||||
if h_collision( self.actor, self.actor_b ) and
|
||||
distancia ( self.actor, self.actor_b )<=self.distancia
|
||||
then
|
||||
self:init()
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function trigger_ev:dialeg_init()
|
||||
table.insert(
|
||||
dialeg.list,
|
||||
{ actor=self.actor,
|
||||
text=self.text,
|
||||
time=self.time,
|
||||
w = math.floor(4.6*#self.text),
|
||||
h = 20,
|
||||
}
|
||||
)
|
||||
trigger_event.disable(self.name)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user