Ejemplo n.º 1
0
        public static void dealDamage(Unit attacker, Unit victim)
        {
            if (attacker.Inv.Wielded != null)
            {

                int finalDamage = CalculateDamage(attacker, victim);
                if (attacker.Inv.Wielded.TypeOfDamage == Weapon.damageTypes.stab && victim.IsUnaware())
                {
                    finalDamage *= 6; //zomg
                    if (attacker is Player)
                        Log.AddLine("You silently stabbed " + victim.Name + "'s neck with your " + attacker.Inv.Wielded.Name + "!!");
                    else
                        Log.AddLine(attacker.Name + " stabs " + victim.Name + " with the " + attacker.Inv.Wielded.Name + "!");
                }
                else
                {
                    if (attacker is Player)
                        Log.AddLine("You hit " + victim.Name + " with your " + attacker.Inv.Wielded.Name + "!");
                    else
                        Log.AddLine(attacker.Name + " hits " + victim.Name + " with the " + attacker.Inv.Wielded.Name + "!");
                }

                victim.Hitpoints -= finalDamage;
                if (attacker is Player)
                    Log.AddDebugMessage(" " + finalDamage.ToString() + " damage");

                if (victim is Player)
                {
                    Gameover.KilledBy = attacker.Name;
                    if (victim.Hitpoints < victim.GetMaxHitpoints() / 3 || victim.Hitpoints < 3)
                        Log.AddAlertMessage("!!LOW HITPOINT WARNING!!");
                }
            }
        }
Ejemplo n.º 2
0
 static int CalculateDamage(Unit attacker, Unit victim)
 {
     int mindamage = attacker.Inv.Wielded.mindamage;
     int maxdamage = attacker.Inv.Wielded.maxdamage;
     int baseDamage = Algorithms.getRandomInt(mindamage, maxdamage+1);
     int finalDamage = (int)(baseDamage + baseDamage * (attacker.Stats.Strength - 10)/10 * attacker.Inv.Wielded.StrengthFactor);
     if (finalDamage < 0) finalDamage = 0;
     return finalDamage;
 }
Ejemplo n.º 3
0
 public Corpse(Unit deadman)
 {
     Appearance = '&';
     weight = 25;
     CoordX = deadman.CoordX;
     CoordY = deadman.CoordY;
     Name = deadman.Name + " corpse";
     Color = deadman.color;
 }
Ejemplo n.º 4
0
 public static void Strangle(Unit attacker, Unit victim)
 {
     if (victim.IsUnaware())
     {
         int kotime = Algorithms.getRandomInt(50, 150);
         victim.KnockedOutTime += 150;
         if (attacker is Player)
             Log.AddLine("You strangle " + victim.Name + "!");
     }
     else
         Log.AddLine(attacker.Name + " tried to grab and strangle " + victim.Name + ", but the victim was aware of it!");
 }
Ejemplo n.º 5
0
 public UnconsciousBody(Unit victim)
 {
     Appearance = '&';
     weight = 25;
     CoordX = victim.CoordX;
     CoordY = victim.CoordY;
     Name = "unconscious " + victim.Name;
     Color = victim.color;
     TurnToWakeUp = victim.Timing.GetCurrentTurn() + victim.KnockedOutTime;
     Knocked = victim;
     Knocked.KnockedOutTime = 0;
 }
Ejemplo n.º 6
0
        public static int MoveCost(Unit acting)
        {
            int agi = acting.Stats.Agility;
            double encumbrance = acting.Inv.getEncumbrance();
            double endurance = acting.Stats.Endurance;
            double encumbModifier;

            double baseCost = 10 + (10 - agi) / 2;

            if (encumbrance == 0)
                encumbModifier = 1;
            else
                encumbModifier = (10/endurance) * (1 + encumbrance / 2); //if encumbered

            double finalCost = baseCost * encumbModifier;
            return (int)Math.Round(finalCost);
        }
Ejemplo n.º 7
0
 public Inventory(Unit ownr)
 {
     owner = ownr;
 }
Ejemplo n.º 8
0
 //do we see the player?
 bool ActorSeesTheTarget()
 {
     Target = World.player;
     int targetX, targetY;
     targetX = Target.CoordX;
     targetY = Target.CoordY;
     int vectorX = Target.CoordX - CoordX;
     int vectorY = Target.CoordY - CoordY;
     double distance = Math.Sqrt(vectorX * vectorX + vectorY * vectorY);
     if (distance <= visibilityRadius)
     {
         if (ViewSector.PointIsInSector(CoordX, CoordY, targetX, targetY, lookX, lookY, ViewAngle))
             if (WorldLOS.VisibleLineExist(CoordX, CoordY, targetX, targetY))
                 return true;
     }
     return false;
 }
Ejemplo n.º 9
0
 public static int TurningCost(Unit acting)
 {
     return 3;
 }
Ejemplo n.º 10
0
 public static int StrangleCost(Unit acting)
 {
     return Algorithms.getRandomInt(15, 25);
 }
Ejemplo n.º 11
0
 public static int SkipTurnCost(Unit acting)
 {
     return 10;
 }
Ejemplo n.º 12
0
 public static int PeepCost(Unit acting)
 {
     return 15;
 }
Ejemplo n.º 13
0
 public static int OpenDoorCost(Unit acting)
 {
     return 10;
 }
Ejemplo n.º 14
0
 public static int ContinuePeepCost(Unit acting)
 {
     return 10;
 }
Ejemplo n.º 15
0
 public static int CloseDoorCost(Unit acting)
 {
     return 10;
 }
Ejemplo n.º 16
0
 public static int AttackCost(Unit acting)
 {
     return 10;
 }