diff --git a/objects/obj_nipper_fire.object.gmx b/objects/obj_nipper_fire.object.gmx new file mode 100644 index 00000000..211950b2 --- /dev/null +++ b/objects/obj_nipper_fire.object.gmx @@ -0,0 +1,272 @@ + + + spr_nipper + 0 + -1 + 0 + 0 + obj_deactenemyparent + <undefined> + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Quite the hothead +//States +//0 = Doing nothing +//1 = Opening its mouth +//2 = firing + + +//How vulnerable is this enemy to various items? +hardness = 0 + +//How vulnerable is this enemy to Mario? +stomp = 1 + +//Facing direction +direct = -1 + +//Animate +image_speed = 0.15 + +//Don't move +hspeed = 0 + +//Not doing anything yet +state = 0 + +//The amount of fireballs which will be spat in a salvo +fireballsalvo = 4 + +//Has not spat any fireballs in this round +hasspat = 0 + +//Fire projectiles +alarm[1] = 25 + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Fire! + +if instance_exists(obj_mario) +{ +//Logic state +state = 2 + +//Spit fireballs which depend upon Mario's distance +if obj_mario.x < x +{ +with instance_create(x,y,obj_nipperfireball) hspeed = -0.03125*(other.x-obj_mario.x-8) +} +else +{ +with instance_create(x,y,obj_nipperfireball) hspeed = -0.03125*(other.x-obj_mario.x+8) +} +//Add one to the amount of fireballs which have been spat so far +hasspat += 1 + +//Play quot sound +audio_play_sound(snd_fireball,0,0) + +//Spit another unless it has already spat enough +if hasspat < fireballsalvo +{ +alarm[2] = 15 +} +else +{ +alarm[0] = 15 +hasspat = 0 +} + +} +//If Mario's dead +else +{ +alarm[0] = 2 +} + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Ready, aim... + +//Prepare to throw +state = 1 +alarm[2] = 30 + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///I'm just doing nothing +state = 0 + +//Prepare to fire +if instance_exists(obj_mario) +{ +alarm[1] = 120 +} + +else +{ +} + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Fire Nipper logic +//Which animation to pick and whether to be animated or not +if state = 0 +{ +sprite_index = spr_nipper +image_speed = 0.15 +} +else +{ +sprite_index = spr_nipper_jump +image_speed = 0 +image_index = 0 +} + +//Look at Mario +if instance_exists(obj_mario) +{ + if obj_mario.x > x + direct = 1 + else + direct = -1 +} + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Draw the Fire Nipper +draw_sprite_ext(sprite_index,image_index,x,y,direct,1,0,c_white,1) + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + 0,16 + 16,16 + + diff --git a/objects/obj_nipperfireball.object.gmx b/objects/obj_nipperfireball.object.gmx new file mode 100644 index 00000000..a9fc6684 --- /dev/null +++ b/objects/obj_nipperfireball.object.gmx @@ -0,0 +1,123 @@ + + + spr_fireball + 0 + -1 + -2 + 0 + <undefined> + <undefined> + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Fire which acts like a hammer + +//Animate +image_speed = 0.15 + +//Gravity +gravity = 0.2 + +//Move up +vspeed = -4.5 + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Destroy below view +if y > view_yview[0] + view_hview[0] + instance_destroy() + +//Correct facing direction +if hspeed < 0 + image_xscale = -1 + +//Speed caps +if hspeed > 2 +{ +hspeed = 2 +} + +if hspeed < -2 +{ +hspeed = -2 +} + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Hurt Mario +with other event_user(0) + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + 8,0 + 8,8 + +