public override void Throw() { base.Throw(); blob.RemoveComponent <Damage>(); velocity = VectorFacing.RotateVectorToFacing(velocity, body.GetFacing()); storedCharge = chargePower + (IsSweet()?sweetBonus:0); }
public override void Throw() { base.Throw(); velocity = VectorFacing.RotateVectorToFacing(velocity, body.GetFacing()); body.movement.velocity += -velocity * 5; SoundManager.PlaySound(SoundManager.SFX_ROCKET_BLAST); }
public void FireGun() { if (ammo > 0 && hasBeenUnpressed) { Blob bulletBlob = new Blob(); bulletBlob.transform.Position = blob.transform.Position; Sprite headSprite = new Sprite(ResourceManager.bullet); bulletBlob.AddComponent(headSprite); Collider collider = new Collider(); collider.bounds = ResourceManager.GetBounds(headSprite.texture); collider.offset = new Vector2(collider.bounds.X, collider.bounds.Y); bulletBlob.AddComponent(collider); bulletBlob.AddComponent(new Damage(DamageValues.throwDamage, DamageValues.gunLegPiercing)); bulletBlob.AddComponent(new DieOutOfBounds()); SoundManager.PlaySound(SoundManager.SFX_GUN_LEG_SHOT); if (!thrown) { facing = body.GetFacing(); } bulletBlob.AddComponent(new Bullet(VectorFacing.RotateVectorToFacing(bulletFireTrajectory, facing))); ammo--; } else if (ammo <= 0 && hasBeenUnpressed) { SoundManager.PlaySound(SoundManager.SFX_EMPTY_GUN); } }
public void IncreaseCharge() { chargePower += chargeSpeed * Time.deltaTime; chargePower = MathHelper.Min(chargePower, chargeMax); GameManager.Instance.SetSecondLabel(chargePower.ToString("0.00")); Vector2 chargeTranslationVector = VectorFacing.RotateVectorToFacing(chargeMove, body.GetFacing()); offset = chargeTranslationVector * (chargePower / chargeMax); blob.transform.LocalPosition = offset + currentAnchor; }
public override void Throw() { base.Throw(); velocity = VectorFacing.RotateVectorToFacing(velocity, body.GetFacing()); if (IsSweet()) { GameManager.Instance.SetSecondLabel("SWEET SHOT"); } velocity *= chargePower + (IsSweet() ? sweetBonus : 0f); }
public override void EndPunch() { if (chargePower >= sweetMin) { Blob b = new Blob(); b.AddComponent(new HitFlash(DamageValues.humanMelee + (chargePower == chargeMax?1:0), 0f, body.GetFacing(), DamageValues.humanPiercing, body.Collider)); Vector2 position = VectorFacing.RotateVectorToFacing(new Vector2(0, 50), body.GetFacing()); b.transform.Position = body.GetColliderCenter() + position + new Vector2(0, -20); SoundManager.PlaySound(SoundManager.SFX_PUNCH); } }
public override void EndPunch() { //TODO nick tweak pubch attack if (chargePower > 0 && ammo-- >= 0) { //make an attack Blob b = new Blob(); b.AddComponent(new HitFlash(DamageValues.robotMelee, 20f, body.GetFacing(), DamageValues.robotPiercing, body.Collider)); Vector2 position = VectorFacing.RotateVectorToFacing(new Vector2(0, 50), body.GetFacing()); b.transform.Position = body.GetColliderCenter() + position + new Vector2(0, -20); SoundManager.PlaySound(SoundManager.SFX_PUNCH); } }
public override void EndPunch() { if (chargePower > 0 && ammo-- >= 0) { Blob b = new Blob(); b.AddComponent(new HitFlash(DamageValues.robotMelee, 20f, body.GetFacing(), DamageValues.robotPiercing, body.Collider)); b.transform.Parent = this.blob.transform; Vector2 position = VectorFacing.RotateVectorToFacing(new Vector2(0, 50), body.GetFacing()); b.transform.LocalPosition = position + new Vector2(25, 0); SoundManager.PlaySound(SoundManager.SFX_PUNCH); } }
public override void EndPunch() { if (chargePower >= .7) { //make an attack int damage = IsSweet() ? 2 : 1; Blob b = new Blob(); b.AddComponent(new HitFlash(DamageValues.humanArm * damage, 50f, body.GetFacing(), DamageValues.humanPiercing, body.Collider)); b.transform.Parent = this.blob.transform; Vector2 position = VectorFacing.RotateVectorToFacing(new Vector2(0, 50), body.GetFacing()); b.transform.LocalPosition = position + new Vector2(25, 0); SoundManager.PlaySound(SoundManager.SFX_PUNCH); chargeSpeed -= .5f; } }
public override void Throw() { base.Throw(); velocity = VectorFacing.RotateVectorToFacing(velocity, body.GetFacing()); if (IsSweet()) { GameManager.Instance.SetSecondLabel("SWEET SHOT"); } SoundManager.PlaySound(SoundManager.SFX_RIP_HUMAN_LIMB); Blob blood = new Blob(); blood.AddComponent(new Sprite(ResourceManager.Blood)); blood.transform.Position = this.blob.transform.Position; blood.GetComponent <Sprite>().SetAnchor(Sprite.AnchorType.Upper_Left); blood.GetComponent <Sprite>().z = 0.99f; blood.GetComponent <Sprite>().scale = 0.5f; velocity *= chargePower + (IsSweet() ? sweetBonus : 0f); }
public override void Throw() { base.Throw(); Facing fireFacing = body.GetFacing(); if (limbType == LimbType.LeftArm || limbType == LimbType.LeftLeg) { fireFacing = VectorFacing.FacingTurnFacing(body.GetFacing(), Facing.Left); } else if (limbType == LimbType.RightArm || limbType == LimbType.RightLeg) { fireFacing = VectorFacing.FacingTurnFacing(body.GetFacing(), Facing.Right); } velocity = VectorFacing.RotateVectorToFacing(velocity, body.GetFacing()); facing = fireFacing; if (IsSweet()) { GameManager.Instance.SetSecondLabel("SWEET SHOT"); } velocity *= chargePower + (IsSweet()?sweetBonus:0f); }
public override void EndPunch() { body.movement.velocity += -DamageValues.rocketKick * VectorFacing.RotateVectorToFacing(velocity, body.GetFacing()); }