Пример #1
0
        /// <summary>
        /// Make the output messaging
        /// </summary>
        /// <returns>actor, target, room</returns>
        private static Tuple <string, string, string> GetOutputStrings(IFightingArt attack, IMobile target, bool blocked, ReadinessState avoidanceType)
        {
            var targetGlyph      = target == null ? "a shadow" : "$T$";
            var actorTargetGlyph = target == null ? "your shadow" : "$T$";

            var verb    = !string.IsNullOrWhiteSpace(attack.ActionVerb) ? attack.ActionVerb : attack.Name;
            var subject = !string.IsNullOrWhiteSpace(attack.ActionSubject) ? attack.ActionSubject + " " : string.Empty;
            var obj     = !string.IsNullOrWhiteSpace(attack.ActionPredicate) ? "and " + attack.ActionPredicate + " " : string.Empty;

            string toOrigin = string.Format("$A$ {0}s {3}{2}{1}.", verb, targetGlyph, obj, subject);
            string toActor  = string.Format("You {0} {3}{2}{1}.", verb, actorTargetGlyph, obj, subject);
            string toTarget = "";

            if (target != null)
            {
                toTarget = string.Format("$A$ {0}s {1}you.", verb, obj);

                if (blocked)
                {
                    switch (avoidanceType)
                    {
                    case ReadinessState.Circle:     //circle is dodge essentially
                        toActor  = string.Format("{0} dodges your attack!", actorTargetGlyph);
                        toTarget = string.Format("You dodge $A$'s {0}.", verb);
                        toOrigin = string.Format("$A$ {0}s {2}{1} but they dodge.", verb, targetGlyph, subject);
                        break;

                    case ReadinessState.Block:
                        toActor  = string.Format("You {0} {2}{1} but they block!", verb, actorTargetGlyph, subject);
                        toTarget = string.Format("$A$ {0}s {1}you but you block it.", verb, subject);
                        toOrigin = string.Format("$A$ {0}s {2}{1} but they block.", verb, targetGlyph, subject);
                        break;

                    case ReadinessState.Deflect:
                        toActor  = string.Format("You {0} {2}{1} but they deflect it!", verb, actorTargetGlyph, subject);
                        toTarget = string.Format("$A$ {0}s {1}you but you deflect it.", verb, subject);
                        toOrigin = string.Format("$A$ {0}s {2}{1} but they deflect the blow.", verb, targetGlyph, subject);
                        break;

                    case ReadinessState.Redirect:
                        toActor  = string.Format("{0} redirects your attack back to you!", actorTargetGlyph);
                        toTarget = string.Format("You redirect $A$s {0} back at them.", verb);
                        toOrigin = string.Format("$A$ {0}s {2}{1} but they redirect the attack back at them.", verb, targetGlyph, subject);
                        break;

                    case ReadinessState.Offensive:
                        //successful clash
                        toActor  = string.Format("{0}'s attack clashes with yours!", actorTargetGlyph);
                        toTarget = string.Format("Your attack clashes with $A$'s.", verb);
                        toOrigin = string.Format("$A$'s {0} clashes with {1}'s attack.", verb, targetGlyph);
                        break;
                    }
                }
            }

            return(new Tuple <string, string, string>(toActor, toTarget, toOrigin));
        }
Пример #2
0
 private void Availability_ReadinessChanged(object sender, EventArgs e)
 {
     readinessChanges++;
     lastReadinessState = (ReadinessState)(e as AvailabilityEventArgs).NewState;
 }