[FIX] Canviat el nom de flow a states que es mes precis
[FIX] Ajustada posició del peu en habitació 27 [FIX] Modificat trigger_event per a que es disparen en una habitació concreta i també segons distancia sense haver de colisionar [FIX] Ending stage 1 [FIX] ELiminades llunes duplicades [NEW] Dialeg per a l'abad
This commit is contained in:
+12
-4
@@ -4,7 +4,7 @@ trigger_event = {
|
||||
|
||||
trigger_ev = {}
|
||||
|
||||
function trigger_event.new ( _name, _tr_func, _tr_init, _tr_update, _a, _b, _time, _text, _distancia )
|
||||
function trigger_event.new ( _name, _tr_func, _tr_init, _tr_update, _a, _b, _time, _text, _distancia, _hab, _collision_req )
|
||||
table.insert( trigger_event.list, {
|
||||
name = _name,
|
||||
trigger = _tr_func,
|
||||
@@ -14,8 +14,10 @@ function trigger_event.new ( _name, _tr_func, _tr_init, _tr_update, _a, _b, _tim
|
||||
actor_b = _b,
|
||||
time = _time,
|
||||
text = _text,
|
||||
hab = _hab,
|
||||
distancia = _distancia,
|
||||
enabled = true,
|
||||
collision_req = _collision_req,
|
||||
running = false,
|
||||
})
|
||||
end
|
||||
@@ -125,9 +127,15 @@ end
|
||||
|
||||
-- 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
|
||||
local in_hab = false
|
||||
if (self.hab~=nil and self.hab==self.actor.hab) or self.hab==nil then in_hab=true end
|
||||
|
||||
local is_collision = true
|
||||
if self.collision_req then
|
||||
is_collision = h_collision( self.actor, self.actor_b )
|
||||
end
|
||||
|
||||
if in_hab and is_collision and distancia ( self.actor, self.actor_b )<=self.distancia then
|
||||
self:init()
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user