示例#1
0
 public DamageEffect(TargetType tt, SingleTargetFormula damageFormula, SingleTargetSuccessFormula hitFormula, MoveEvent response)
 {
     _response      = response;
     _tt            = tt;
     _hitFormula    = hitFormula;
     _damageformula = damageFormula;
     _response      = response;
 }
示例#2
0
        public void RequestMoveEventDisplay(MoveEvent m, Character caster, Character target, bool didHit, int damage)
        {
            string completeMessage = m.Message.Replace("%c", caster.Name).Replace("%t", target == null ? "" : target.Name);
            string completeOnHit   = m.OnHit.Replace("%c", caster.Name).Replace("%t", target == null ? "" : target.Name).Replace("%d", damage.ToString());
            string completeOnMiss  = m.OnMiss.Replace("%c", caster.Name).Replace("%t", target == null ? "" : target.Name);

            Console.WriteLine(completeMessage);
            if (didHit)
            {
                Console.WriteLine(completeOnHit);
            }
            else
            {
                Console.WriteLine(completeOnMiss);
            }
        }
示例#3
0
        private MoveEffect buildEffect(XmlNode root)
        {
            TargetType tt = (TargetType)System.Enum.Parse(typeof(TargetType), root["tt"].InnerText);
            MoveEvent  ev = root["event"] == null ? null : eventBuilder.BuildMoveEventFromXml(root["event"]);
            int        successformula, damageformula;

            switch (root["type"].InnerText)
            {
            case "DAMAGE":
                damageformula = int.Parse(root["formula"].InnerText);
                SingleTargetFormula fmla = Formulas.SingleTargetFormulas[damageformula];
                successformula = int.Parse(root["success"].InnerText);
                SingleTargetSuccessFormula successfmla = SuccessFormulas[successformula];
                return(new DamageEffect(tt, fmla, successfmla, ev));

            case "ESCAPE":
                successformula = int.Parse(root["success"].InnerText);
                NoTargetSuccessFormula escapefmla = NoTargetSuccessFormulas[successformula];
                return(new EscapeEffect(escapefmla, ev));

            default:
                return(null);
            }
        }
示例#4
0
 public EscapeEffect(NoTargetSuccessFormula success, MoveEvent response)
 {
     _success  = success;
     _response = response;
 }