Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// @description Insert description here
- // You can write your code in this editor
- var sonic = Player
- if place_meeting(x,y,obj_chaos_spear)
- {
- action = 2
- }
- with(sonic)
- {
- if action != act_death
- {
- if collision_onset(other.id) && action != act_hit
- {
- if homing_att == off
- {
- if animation == ani_roll || animation == ani_homing || (global.player_id == "knuckles" && chaos_control == on)
- {
- other.action = 1
- if !ground && animation != ani_boost && boost == off
- {
- vsp = 0
- vsp-= 1.5
- }
- if ground
- {
- vsp = 10
- }
- }
- if animation == ani_boost
- {
- other.action = 1
- if full_vspeed != 0
- {
- full_vspeed = 0
- }
- }
- if animation == ani_spindash
- {
- other.action = 1
- }
- if boost_ski == on
- {
- other.action = 1
- }
- if animation != ani_homing && animation != ani_roll && animation != ani_boost && animation != ani_spindash && boost_ski == off
- {
- if invincibility == -1
- {
- if character != supersonic
- {
- if action != act_death
- {
- player_hurt()
- }
- }
- else
- {
- other.action = 1
- }
- }
- else if invincibility < inv_action
- {
- if invincibility > 10000 && invincibility < 10800
- {
- other.action = 1
- }
- else
- {
- other.action = 0
- }
- }
- else
- {
- other.action = 0
- }
- }
- }
- if just_hom == on
- {
- spring_lock = on
- just_hom = off
- }
- }
- }
- else
- {
- exit;
- }
- }
- if action == 1
- {
- hp-= 1
- if hp <= 0
- {
- with(id)
- {
- is_deactivated = true
- }
- instance_deactivate_object(id)
- // This was destroy, but was changes so we can re-activate certain objects
- // By the use of sensors
- instance_create(x,y,obj_big_explostion)
- if sonic.animation == sonic.ani_boost
- {
- sound_play(sfx_break_enemy)
- }
- else
- {
- sound_play(sfx_enemy_pop)
- }
- }
- if sonic.homing_att == on sonic.homing_att = off
- sonic.full_vspeed = 0
- if global.player_id == "sonic" || global.player_id == "blaze"
- {
- sonic.boost_pwr += sonic.boost_gain
- }
- if global.player_id == "shadow"
- {
- sonic.chaos_pwr+= 10
- }
- action = 0
- }
- if action == 2
- {
- instance_destroy(other)
- hp-= 1
- if hp <= 0
- {
- with(id)
- {
- is_deactivated = true
- }
- instance_destroy(self)
- // This was destroy, but was changes so we can re-activate certain objects
- // By the use of sensors
- instance_create(x,y,obj_big_explostion)
- var be = instance_nearest(x,y,obj_big_explostion)
- with(be)
- {
- shadow = 1
- }
- sound_play(sfx_enemy_pop)
- }
- }
- if global.pause == on
- {
- image_speed = 0
- }
- else
- {
- image_speed = 1
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement