Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///TONY HM2 ABILITIES CODE. FOR TUTORIAL.
- ///objPKillFat
- //Create
- image_speed=0.2
- ammo=0
- bled=0
- //Step
- if image_index >= 5 and bled = 0 {
- audio_play_sound(choose(sndPunch, sndPunch1, sndPunch2, sndPunch3), 0, false)
- audio_play_sound(sndDoorHit, 0, false)
- audio_play_sound(sndBonesBreak, 0, false)
- global.shake = 18
- my_id = instance_create(x + lengthdir_x(17, image_angle) - 1 + random(2), y + lengthdir_y(17, image_angle) - 1 + random(2), objBloodSquirt)
- my_id = instance_create(x, y, objDeadBody)
- my_id.sprite_index = sprEFatKneed
- my_id.image_index = image_index
- my_id.image_angle = image_angle
- my_id.speed = 1.5
- my_id.direction = image_angle
- my_id.friction = 0.1
- bled = 1
- }
- //Animation End
- image_speed = 0
- image_index = 0
- if global.maskindex = 4 global.factor += 4
- myx = x + lengthdir_x(5, image_angle)
- myy = y + lengthdir_y(5, image_angle)
- my_id=instance_create(x,y-12,objScore)
- my_id.text="+"+string((1000)+400*(global.factor-1))+"pts"
- global.myscore += (1000) + 400 * (global.factor)
- global.killscore += 1000
- global.boldscore += 600 * global.factor
- global.combotime = 240
- global.combo += 1
- global.killx[global.kills] = x
- global.killy[global.kills] = y
- global.kills += 1
- ds_list_add(global.bonuslist, "Execution")
- if global.combotime < 12 global.combotime = 12
- instance_create(x + lengthdir_x(24, image_angle), y + lengthdir_y(24, image_angle), objBloodPool)
- my_id = instance_create(x, y, objPlayerMouse)
- my_id.reload = 5
- instance_destroy()
- //Draw
- if image_index<=5 draw_sprite_ext(sprEFatDieKneed,image_index,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha)
- draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha)
- ///objFatKnockedOut - Has a depth of 1. Has objKnockedOut as a parent.
- //Create
- image_speed=0
- friction=0.15
- alarm[0]=120+random(100)
- image_index = 1
- startx=x
- starty=y
- hits=0
- energie = 5
- shot=0
- //Alarm 0
- image_speed = 0.25
- //Step
- if image_speed > 0 exit
- scrMoveSolidOn()
- if !place_free(x, y) {
- if speed > 0 {
- move_outside_solid(direction - 180, 8)
- } else {
- if place_free(x + lengthdir_x(7, direction - 180), y + lengthdir_y(7, direction - 180)) {
- dir = direction
- if sprite_index = sprEGetUp sprite_index = sprEGetUpLean
- if sprite_index = sprPoliceGetUp sprite_index = sprPoliceGetUpLean
- direction = round(direction * (1 / 90)) * 90
- image_angle = direction - 180
- if place_free(x + lengthdir_x(5, direction), y + lengthdir_y(5, direction)) {
- direction = dir
- if sprite_index = sprEGetUpLean sprite_index = sprEGetUp
- if sprite_index = sprPoliceGetUpLean sprite_index = sprPoliceGetUp
- }
- }
- }
- speed = 0
- } else {
- if !place_free(x + lengthdir_x(5, direction), y + lengthdir_y(5, direction)) {
- move_contact_solid(direction, 8)
- dir = direction
- if sprite_index = sprEGetUp sprite_index = sprEGetUpLean
- if sprite_index = sprPoliceGetUp sprite_index = sprPoliceGetUpLean
- direction = round(direction * (1 / 90)) * 90
- image_angle = direction - 180
- if place_free(x + lengthdir_x(5, direction), y + lengthdir_y(5, direction)) {
- direction = dir
- if sprite_index = sprEGetUpLean sprite_index = sprEGetUp
- if sprite_index = sprPoliceGetUpLean sprite_index = sprPoliceGetUp
- }
- }
- }
- scrMoveSolidOff()
- //Collision event with objBullet
- image_xscale = 3
- image_yscale = 3
- global.my_id = id
- bullets = 0
- energie -= 1
- with objBullet {
- if place_meeting(x, y, global.my_id) {
- global.my_id.bullets += 1
- my_id = instance_create(x, y, objSmokeHit)
- my_id.image_angle = image_angle
- my_id.direction = image_angle
- my_id.speed = random(1)
- my_id.image_blend = merge_color(c_red, c_maroon, 0.7)
- instance_destroy()
- alert = 1
- }
- }
- if energie == 0 shot = 1
- image_xscale = 1
- image_yscale = 1
- //Shot to death.
- if shot == 1 {
- my_id=instance_create(x,y-12,objScore)
- my_id.text="+"+string((500)+40*(global.factor-1))+"pts"
- global.myscore += (500) + 40 * (global.factor)
- global.killscore += 500
- global.boldscore += 600 * global.factor
- global.combotime = 240
- global.combo += 1
- global.killx[global.kills] = x
- global.killy[global.kills] = y
- global.kills += 1
- bullets = 4
- repeat(3) {
- my_id = instance_create(x, y, objBloodSplat)
- my_id.direction = image_angle - 20 + random(40)
- my_id.speed = 2 + random(2)
- my_id.image_angle = random(360)
- }
- repeat(4) {
- my_id = instance_create(x, y, objBloodDrop)
- my_id.direction = image_angle - 20 + random(40)
- my_id.speed = 3 + random(3)
- my_id.image_angle = my_id.direction
- }
- repeat(1) {
- instance_create(x + lengthdir_x(image_xscale, image_angle), y + lengthdir_y(image_yscale, image_angle), objBloodPool)
- }
- repeat(1) {
- my_id = instance_create(x, y, objDeadBody)
- my_id.direction = direction - 180
- my_id.speed = 0.5
- my_id.sprite_index = sprEFatDead
- if shot == 1 my_id.image_index = floor(random(2))
- else my_id.image_index = 2 + floor(random(2))
- my_id.image_angle = my_id.direction
- instance_destroy()
- exit
- }
- }
- //Animation End
- if sprite_index = sprEFatGetUp {
- my_id = instance_create(x, y, objEnemyFat)
- my_id.sprite_index = sprEFatWalk
- instance_destroy()
- }
- my_id.angle=image_angle-180
- my_id.direction = image_angle
- my_id.risen = 1
- my_id.startx = startx
- my_id.starty = starty
- with my_id {
- scrMoveSolidOn()
- if !place_free(x, y) {
- x = startx
- y = starty
- }
- scrMoveSolidOff()
- }
- //Draw
- draw_sprite_ext(sprite_index,image_index,x+1,y+1,image_xscale,image_yscale,angle,c_black,0.5)
- draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,angle,image_blend,image_alpha)
- ///objPKillDog
- //Create
- targetindex=0
- index=0
- image_speed=0
- dead=0
- cobra=0
- left=1
- ammo = objPlayerMouse.ammo
- //Step
- if image_index>=10 and dead=0 {
- audio_play_sound(sndPunch, 0, false)
- audio_play_sound(sndHit1, 0, false)
- global.shake=5
- repeat (2+random(1)) {
- my_id=instance_create(x+scrPosDirX(21,-3,image_angle)-1+random(2),y+scrPosDirY(21,-3,image_angle)-1+random(2),objBloodSquirt)
- my_id.image_angle=image_angle-120+random(240)
- }
- repeat (3) instance_create(x+scrPosDirX(21,-3,image_angle)-1+random(2),y+scrPosDirY(21,-3,image_angle)-1+random(2),objBigBlood)
- my_id=instance_create(x,y-12,objScore) {
- my_id.text="+"+string((1500)+400*(global.factor-1))+"pts"
- global.myscore += (1500) + 400 * (global.factor)
- global.killscore += 1500
- global.boldscore += 1000 * global.factor
- global.combotime = 600
- global.combo += 1
- global.killx[global.kills] = x
- global.killy[global.kills] = y
- global.kills += 1
- ds_list_add(global.bonuslist, "Execution")
- if global.combotime < 12 global.combotime = 12
- dead=1
- }
- }
- if image_index<17 image_index+=0.3 else {
- my_id=instance_create(x+scrPosDirX(9,5,image_angle),y+scrPosDirY(9,5,image_angle),objDeadBody)
- my_id.sprite_index=sprDogDeadBlunt
- my_id.image_index=5
- my_id.image_angle=image_angle
- if sprite_index=sprPKillDog {my_id=instance_create(x,y,objPlayerMouse) my_id.sprite_index=sprPWalkUnarmed}
- instance_destroy()
- }
- //Animation End
- image_speed=0
- image_index=0
- //Draw
- if round(image_index)>=15 draw_sprite_ext(sprDogDeadBlunt,2,x+scrPosDirX(9,5,image_angle),y+scrPosDirY(9,5,image_angle),image_xscale,image_yscale,image_angle,image_blend,image_alpha)
- draw_sprite_ext(sprite_index,image_index,x+1,y+1,image_xscale,image_yscale,image_angle,c_black,0.5)
- draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha)
- ///scrPosDirX
- return lengthdir_x(point_distance(0,0,argument0,argument1),point_direction(0,0,argument0,argument1)+argument2)
- ///scrPosDirY
- return lengthdir_y(point_distance(0,0,argument0,argument1),point_direction(0,0,argument0,argument1)+argument2)
- ///Code that allows Tony to knock out fats - Add to step event of objPlayerMouse
- with objEnemy {
- if place_meeting(x,y,objPlayer) or place_meeting(x+global.spacex,y+global.spacey,objPlayer) {
- mask_index=sprWeaponMask
- if object_index = objEnemyFat and global.maskindex = 2 {
- edir = point_direction(objPlayer.lastx, objPlayer.lasty, x, y)
- audio_play_sound(sndDoorHit, 0, false)
- global.shake = 3
- my_id = instance_create(x, y, objFatKnockedOut)
- my_id.direction = edir - 10 + random(20)
- my_id.angle = my_id.direction
- with my_id move_outside_solid(angle - 180, 16)
- my_id.speed = 2
- instance_destroy()
- } else if scrCollisionLineExt(x,y,objPlayer.lastx,objPlayer.lasty,4,objSolid,objDoorV,objWallSoftH) or object_index=objEnemyFat or object_index=objInspector nothing=1 else {
- mask_index=sprMask
- global.shake=7
- my_id=instance_create(x,y-12,objScore)
- if object_get_parent(object_index)=objEnemyIdle {
- if room=rmTrainstationEntrance sprite_index=sprEWalkKnife else sprite_index=choose(sprEWalkShotgun,sprEWalkM16)
- }
- ///Code that allows fats to be executed - Add to scrKillShield
- //Execute bouncers.
- if place_meeting(x, y, objFatKnockedOut) and global.exposed = 0 and global.maskindex = 2 {
- with objFatKnockedOut {
- image_xscale = 3
- image_yscale = 3
- if place_meeting(x, y, objPlayer) and global.test = 0 {
- global.test = 2
- my_id = instance_create(x, y, objPKillFat)
- my_id.maskindex = global.maskindex
- my_id.maskon = global.maskon
- my_id.image_angle = angle
- my_id.image_index = 1
- instance_destroy()
- instance_destroy(objPlayerMouse)
- }
- }
- }
- ///Code that allows dogs to be executed - Add to step event of objPlayerMouse
- if global.maskindex == 2 {
- if sprite_index == sprPAttackPunch {
- global.spacex=lengthdir_x(12,dir)
- global.spacey=lengthdir_y(12,dir)
- with objEnemy {
- if place_meeting(x,y,objPlayer) or place_meeting(x-global.spacex,y-global.spacey,objPlayer) {
- if object_index == objDogPatrol and (round(direction*(1/45))*45=round((objPlayer.dir-180)*(1/45))*45 or round(direction*(1/45))*45=round((objPlayer.dir+180)*(1/45))*45) {
- my_id=instance_create(objPlayer.x,objPlayer.y,objPKillDog)
- my_id.image_angle=objPlayer.dir
- my_id.ammo=ammo
- my_id.playerx=x
- my_id.playery=y
- with objPlayer {if object_index=objPlayerMouse instance_destroy()}
- instance_destroy()
- exit
- }
- }
- }
- }
- }
- //Code that prevents objDeadBody from changing image y_scale of sprDogDeadBlunt - Add to create event
- if global.isdogexecution = true {
- image_yscale = image_yscale
- global.isdogexecution = false
- }else{
- image_yscale = -1 + round(random(1)) * 2
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement