Add in custom explosion blink timer to mob api
This commit is contained in:
parent
524317e461
commit
9bd7774e76
@ -87,6 +87,7 @@ mob_register.explosion_power = def.explosion_power
|
||||
mob_register.tnt_timer = nil
|
||||
mob_register.explosion_time = def.explosion_time
|
||||
mob_register.explosion_blink_color = def.explosion_blink_color or "white"
|
||||
mob_register.explosion_blink_timer = def.explosion_blink_timer or 0.2
|
||||
|
||||
mob_register.custom_function_begin = def.custom_function_begin
|
||||
mob_register.custom_function_end = def.custom_function_end
|
||||
|
@ -39,7 +39,7 @@ mobs.create_timer_functions = function(def,mob_register)
|
||||
self.tnt_timer = self.tnt_timer - dtime
|
||||
self.tnt_tick_timer = self.tnt_tick_timer - dtime
|
||||
if self.tnt_tick_timer <= 0 and not self.dead then
|
||||
self.tnt_tick_timer = 0.2
|
||||
self.tnt_tick_timer = self.explosion_blink_timer
|
||||
self.tnt_mod_state = math.abs(self.tnt_mod_state-1)
|
||||
if self.tnt_mod_state == 0 then
|
||||
self.object:set_texture_mod("")
|
||||
|
@ -480,6 +480,7 @@ mobs.register_mob(
|
||||
explosion_radius = 6, -- how far away the mob has to be to initialize the explosion
|
||||
explosion_power = 14, -- how big the explosion is (radius)
|
||||
explosion_time = 3, -- how long it takes for a mob to explode
|
||||
explosion_blink_timer = 0.1, -- how fast the blinking happens
|
||||
|
||||
die_in_light = false,
|
||||
--die_in_light_level = 12,
|
||||
|
Loading…
x
Reference in New Issue
Block a user