Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (mouseJoint != null)
- {
- if (Std.is(_owner.attacker,Player))
- {
- trace("checkpoint 1");
- var ragdollPlayer:Player = cast(_owner.attacker, Player);
- var chainsaw_muzzle:Bone = ragdollPlayer.spine.skeleton.findBone("muzzle");
- bone_src.x = chainsaw_muzzle.worldX;
- bone_src.y = chainsaw_muzzle.worldY;
- trace("checkpoint 2");
- mouseJoint.anchor1 = new Vec2(bone_src.x, bone_src.y);
- trace("checkpoint 3");
- uTorso.body.allowRotation = false;
- head.body.allowRotation = false;
- if (mouseJoint.space != null)
- {
- if (FlxG.random.bool(2))
- Utils.quickEmitPoint(FlxPoint.weak(bone_src.x,bone_src.y), "assets/img/particles/tiny_blood.png", 2, false);
- if (FlxG.random.bool(1))
- Utils.quickEmitPoint(FlxPoint.weak(bone_src.x, bone_src.y), "assets/img/particles/gib3.png", FlxG.random.int(1, 5), true, null, 0, 800);
- if (FlxG.random.bool(1))
- Utils.quickEmitPoint(FlxPoint.weak(bone_src.x, bone_src.y), "assets/img/particles/gib4.png", 1, true, null, 0, 800 );
- if (FlxG.random.bool(1))
- Utils.quickEmitPoint(FlxPoint.weak(bone_src.x, bone_src.y), "assets/img/particles/gib6.png", 1, true, null, 0, 800 );
- if (FlxG.random.bool(1))
- Utils.quickEmitPoint(FlxPoint.weak(bone_src.x, bone_src.y), "assets/img/particles/gib5.png", 1, true, null, 0, 800 );
- if (FlxG.random.bool(1))
- Utils.quickEmitPoint(FlxPoint.weak(bone_src.x,bone_src.y), "assets/img/particles/gib7.png", 1, true, null, 0, 800);
- if (FlxG.random.bool(40))
- {
- ParticlesGroup.emit(FlxPoint.weak(bone_src.x,bone_src.y), BaseParticle.blood_drop, 2,null,1, FlxColor.RED);
- ParticlesGroup.emit(FlxPoint.weak(bone_src.x,bone_src.y), BaseParticle.blood_mist, 1, null, 1, FlxColor.RED);
- //blood squirt
- if (ragdollPlayer.spine.facing == FlxObject.RIGHT)
- 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);
- else
- 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);
- }
- }
- trace("checkpoint 4");
- if (!ragdollPlayer.player_shoot)
- {
- head.body.allowRotation = true;
- uTorso.body.allowRotation = true;
- // uTorso.body.applyImpulse(new Vec2(ragdollPlayer.velocity.x , ragdollPlayer.velocity.y ));
- mouseJoint.space = null;
- mouseJoint = null;
- trace("mouseJoint is now null");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement