Exemplo n.º 1
0
    //private IDictionary<string, CardEffect> _cardDictionary = new Dictionary<string, CardEffect>();

    public CardEffect NewCardEffect(MajorArcanaCard majorCard, MinorArcanaCard minorCard)
    {
        //look for key
        var key = _buildKey(majorCard, minorCard);

        Debug.Log(key);
        CardEffect effect;

        if (_cardDictionary.ContainsKey(key))
        {
            _cardDictionary.TryGetValue(key, out effect);
            return(effect);
        }
        else
        {
            // add to dictionary, body and wheel of fortune
            //based on suit and value
            string[] aspectMajor = majorCard.AspectCardName.Split(':');
            if (aspectMajor[0] == "Divine")
            {
                effect = new DivineEffect(0);
            }
            else if (aspectMajor[0] == "Mind")
            {
                effect = new MindEffect(0);
            }
            else if (aspectMajor[0] == "Body")
            {
                effect = new BodyEffect(0, 0);
            }
            else
            {
                effect = new BodyEffect(-1, -1);
            }

            _cardDictionary.Add(key, effect);
            return(effect);
        }
    }
Exemplo n.º 2
0
 public void OnInjury(ShPlayer player, BodyPart part, BodyEffect effect, byte amount)
 {
     player.AddInjury(part, effect, amount);
     player.svPlayer.Send(SvSendType.Self, Channel.Reliable, ClPacket.AddInjury, (byte)part, (byte)effect, amount);
 }