Exemplo n.º 1
0
        public override bool BoonReady(GameObject player)
        {
            int?difference = DifficultyEvaluation.GetDifficultyRating(Romancable.ParentObject, player);

            if (difference == null)
            {
                difference = 0;
            }
            return(this.Romancable.ParentObject.pBrain.GetFeeling(player) > 65 + difference);
        }
Exemplo n.º 2
0
        public void ChanceToFall(GameObject rider, float chance, GameObject mount)
        {
            if (mount.GetPart <Brain>() != null)
            {
                float feeling = mount.GetPart <Brain>().GetFeeling(rider);
                chance += (feeling * -1) * 0.01f;
                int?difference = DifficultyEvaluation.GetDifficultyRating(mount, rider);
                if (difference == null)
                {
                    difference = 0;
                }
                chance += (difference * 0.01f).GetValueOrDefault(0f);

                if (rider.GetPart <Body>() != null)
                {
                    List <BodyPart> parts        = rider.GetPart <Body>().GetParts();
                    float           limblessfall = 10f;
                    foreach (BodyPart part in parts)
                    {
                        if (part.Type == "Arm" ||
                            part.Type == "Feet" ||
                            part.Type == "Tail")
                        {
                            limblessfall = limblessfall / 10f;
                        }
                    }
                    chance += limblessfall;
                }
            }

            Double roll = Stat.Rnd2.NextDouble() * 100;

            //IPart.AddPlayerMessage("fall?"+roll.ToString()+"/"+chance.ToString());
            if (roll <= chance)
            {
                if (rider.IsPlayer())
                {
                    IPart.AddPlayerMessage("You fall from " + mount.the + mount.DisplayNameOnly);
                }
                Dismount(rider);
                rider.ApplyEffect(new Prone());
            }
        }