Advertisement
Guest User

Untitled

a guest
Jun 6th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 2.59 KB | None | 0 0
  1. if (mouseJoint != null)
  2.         {
  3.             if (Std.is(_owner.attacker,Player))
  4.             {
  5.                 trace("checkpoint 1");
  6.                 var ragdollPlayer:Player = cast(_owner.attacker, Player);
  7.                
  8.                 var chainsaw_muzzle:Bone = ragdollPlayer.spine.skeleton.findBone("muzzle");
  9.                 bone_src.x = chainsaw_muzzle.worldX;
  10.                 bone_src.y = chainsaw_muzzle.worldY;   
  11.                 trace("checkpoint 2");
  12.                 mouseJoint.anchor1 = new Vec2(bone_src.x, bone_src.y);
  13.                 trace("checkpoint 3");
  14.                 uTorso.body.allowRotation = false;
  15.                 head.body.allowRotation = false;
  16.                
  17.                 if (mouseJoint.space != null)
  18.                 {
  19.                     if (FlxG.random.bool(2))                     
  20.                     Utils.quickEmitPoint(FlxPoint.weak(bone_src.x,bone_src.y), "assets/img/particles/tiny_blood.png", 2, false);
  21.                    
  22.                     if (FlxG.random.bool(1))   
  23.                     Utils.quickEmitPoint(FlxPoint.weak(bone_src.x, bone_src.y), "assets/img/particles/gib3.png", FlxG.random.int(1, 5), true, null, 0, 800);
  24.                    
  25.                     if (FlxG.random.bool(1))
  26.                     Utils.quickEmitPoint(FlxPoint.weak(bone_src.x, bone_src.y), "assets/img/particles/gib4.png", 1, true, null, 0, 800 );
  27.                    
  28.                     if (FlxG.random.bool(1))
  29.                     Utils.quickEmitPoint(FlxPoint.weak(bone_src.x, bone_src.y), "assets/img/particles/gib6.png", 1, true, null, 0, 800 );
  30.                    
  31.                     if (FlxG.random.bool(1))
  32.                     Utils.quickEmitPoint(FlxPoint.weak(bone_src.x, bone_src.y), "assets/img/particles/gib5.png", 1, true, null, 0, 800 );
  33.                    
  34.                     if (FlxG.random.bool(1))
  35.                     Utils.quickEmitPoint(FlxPoint.weak(bone_src.x,bone_src.y), "assets/img/particles/gib7.png", 1, true, null, 0, 800);                
  36.                    
  37.                     if (FlxG.random.bool(40))
  38.                     {
  39.                         ParticlesGroup.emit(FlxPoint.weak(bone_src.x,bone_src.y), BaseParticle.blood_drop, 2,null,1, FlxColor.RED);
  40.                         ParticlesGroup.emit(FlxPoint.weak(bone_src.x,bone_src.y), BaseParticle.blood_mist, 1, null, 1, FlxColor.RED);
  41.  
  42.                         //blood squirt
  43.                         if (ragdollPlayer.spine.facing == FlxObject.RIGHT)
  44.                             ParticlesGroup.emit(FlxPoint.weak(bone_src.x,bone_src.y), BaseParticle.blood_squirt, 1, null, FlxG.random.float(0.5,1), FlxColor.RED, null, false);
  45.                         else
  46.                             ParticlesGroup.emit(FlxPoint.weak(bone_src.x,bone_src.y), BaseParticle.blood_squirt, 1, null, FlxG.random.float(0.5,1), FlxColor.RED, null, true);
  47.                     }
  48.                 }
  49.                 trace("checkpoint 4");
  50.                 if (!ragdollPlayer.player_shoot)
  51.                 {
  52.                     head.body.allowRotation = true;
  53.  
  54.                     uTorso.body.allowRotation = true;
  55.                    
  56.                 //  uTorso.body.applyImpulse(new Vec2(ragdollPlayer.velocity.x , ragdollPlayer.velocity.y  ));
  57.                    
  58.                     mouseJoint.space = null;
  59.                     mouseJoint = null;
  60.                    
  61.                     trace("mouseJoint is now null");
  62.                 }
  63.                  
  64.             }
  65.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement