Ejemplo n.º 1
0
        public double MeasureAfter(EventContext context, Game game)
        {
            //Do the changed variables belong to us?
            if(Perspective is AICharacter && context.HasChanges())
            {
                double result = 0.0;
                AICharacter me = Perspective as AICharacter;
                foreach(var pair in me.GetImportantCharacters())
                {
                    double change = EvaluateChangedModifiers(pair.Key, context, game);
                    if (change != 0.0)
                    {
                        if (pair.Value == Relationship.Self)
                            result += change;
                        else if (pair.Value == Relationship.Family)
                            result += change * 0.9;
                        else if (pair.Value == Relationship.Friend)
                            result += change * 0.5;
                        else if (pair.Value == Relationship.Rival)
                            result -= change;
                    }
                }
                return result;
            }

            return 0.0;
        }