public DeployArgumentAction(AbstractCharacter source, AbstractArgument argumentToDeploy, int stacksToDeploy, bool deployNewCopy = false)
 {
     this.owner            = source;
     this.argumentToDeploy = argumentToDeploy;
     this.stacksToDeploy   = stacksToDeploy;
     this.deployNewCopy    = deployNewCopy;  // if true, deploy a new copy of the argument even if one already exists
 }
Пример #2
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        int count = source.GetSupportArguments().Count;

        NegotiationManager.Instance.AddAction(new DamageAction(target, target.OWNER, MIN_DAMAGE, MAX_DAMAGE, this));
    }
Пример #3
0
        public void SwitchTurn()
        {
            AbstractCharacter firstCharacter = Characters[0];

            Characters.Remove(firstCharacter);
            Characters.Add(firstCharacter);
        }
Пример #4
0
        public void SetWinningSide(Coords startPositionOfCharacter, int sizeOfGraphSide)
        {
            Coords[] winningPositions = new Coords[sizeOfGraphSide];
            bool     isTopSide        = startPositionOfCharacter.y == 0;
            bool     isRightSide      = startPositionOfCharacter.x == sizeOfGraphSide - 1;
            bool     isBottomSide     = startPositionOfCharacter.y == sizeOfGraphSide - 1;
            bool     isLeftSide       = startPositionOfCharacter.x == 0;

            AbstractCharacter character = Characters
                                          .Find(ch => ch.CurrentPosition == startPositionOfCharacter);

            winningPositions = winningPositions.Select((_, i) => {
                if (isTopSide)
                {
                    return(new Coords(i, sizeOfGraphSide - 1));
                }
                else if (isRightSide)
                {
                    return(new Coords(0, i));
                }
                else if (isBottomSide)
                {
                    return(new Coords(i, 0));
                }
                else if (isLeftSide)
                {
                    return(new Coords(sizeOfGraphSide - 1, i));
                }
                return(null);
            }).ToArray();

            WinPositions.Add(character, winningPositions);
        }
Пример #5
0
        public override void PlayAction(AbstractCharacter character)
        {
            MovementComponent movementComponent = character.GetComponent <MovementComponent>();

            movementComponent.OnFinishedAction += OnMovementFinished;
            movementComponent.Move(this.destination);
        }
Пример #6
0
 public CutBack(AbstractCharacter owner) : base("CutBack", 0, 5, 0, 0,
                                                "", new Dictionary <Keyword, int> {
     { Keyword.Deal, 5 }
 }, owner,
                                                CardModifier.Upper, CardRarity.Starter, CardTarget.Enemy)
 {
 }
Пример #7
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        if (target.isCore)
        {
            throw new Exception("Can only target support arguments with Turnabout!");
        }
        int cnt          = (this.isUpgraded) ? 1 + source.curAP : source.curAP;
        int stacksToGain = Math.Min(target.stacks, cnt);

        target.stacks -= cnt;
        if (target.stacks <= 0)             // Destroy the argument if it falls below 0 stacks
        {
            target.stacks = 0;
            NegotiationManager.Instance.AddAction(new DestroyArgumentAction(target, this));
        }

        List <AbstractArgument> recipients = this.OWNER.GetTargetableArguments();

        if (recipients.Count > 0)
        {
            int index = UnityEngine.Random.Range(0, recipients.Count);
            NegotiationManager.Instance.AddAction(new AddStacksToArgumentAction(recipients[index], stacksToGain));
        }
    }
Пример #8
0
 public Glimpse(AbstractCharacter owner) : base("Glimpse", 1, 6, 1, 0, "",
                                                new Dictionary <Keyword, int> {
     { Keyword.Deal, 6 }, { Keyword.SelfCost, 1 }
 }, owner, CardModifier.Lower,
                                                CardRarity.Starter, CardTarget.Enemy)
 {
 }
Пример #9
0
 public PlantArgumentAction(AbstractCharacter target, AbstractArgument argumentToPlant, int stacksToPlant, bool plantNewCopy = false)
 {
     this.owner           = target;
     this.argumentToPlant = argumentToPlant;
     this.stacksToPlant   = stacksToPlant;
     this.plantNewCopy    = plantNewCopy;  // if true, plant a new copy of the argument even if one already exists
 }
Пример #10
0
 public JadePieces(AbstractCharacter owner) : base("JadePieces", 0, 2 * owner.Weapon.Damage, 0, 0,
                                                   "", new Dictionary <Keyword, int> {
     { Keyword.Deal, 2 * owner.Weapon.Damage }
 }, owner,
                                                   CardModifier.Middle, CardRarity.Starter, CardTarget.Enemy)
 {
 }
Пример #11
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        if (target.isCore || target.OWNER != this.OWNER)
        {
            throw new Exception("You must target friendly support arguments with Interrogate!");
        }
        int damageToDeal        = target.stacks * MULTIPLIER;
        AbstractCharacter enemy = TurnManager.Instance.GetOtherCharacter(target.OWNER);

        // Damage enemy arguments
        NegotiationManager.Instance.AddAction(new DamageAction(enemy.GetCoreArgument(), enemy, damageToDeal, damageToDeal, this));
        List <AbstractArgument> nonCoreArgs = enemy.GetTargetableArguments();

        foreach (AbstractArgument arg in nonCoreArgs)
        {
            NegotiationManager.Instance.AddAction(new DamageAction(arg, arg.OWNER, damageToDeal, damageToDeal, this));
        }
        // Add/change Ambience
        if (this.isUpgraded)
        {
            NegotiationManager.Instance.AddAction(new SetAmbienceAction(AmbienceState.DANGEROUS));
        }
        else
        {
            NegotiationManager.Instance.AddAction(new DeployArgumentAction(this.OWNER, new ArgumentAmbientShiftAggression(), INFLUENCE));
        }

        // Destroy sacrifical argument
        NegotiationManager.Instance.AddAction(new DestroyArgumentAction(target));
    }
Пример #12
0
 public override void LinkEngineCharacter(AbstractCharacter engineCharacter)
 {
     base.LinkEngineCharacter(engineCharacter);
     PacmanEngine.OnDie              += Die;
     PacmanEngine.OnEnableSpeedMode  += ChangeSkin;
     PacmanEngine.OnDisableSpeedMode += ChangeSkin;
 }
Пример #13
0
 public WaterMoon(AbstractCharacter owner) : base("WaterMoon", owner.Weapon.Cost, owner.Weapon.Damage,
                                                  0, 0, "", new Dictionary <Keyword, int> {
     { Keyword.Deal, owner.Weapon.Damage }
 },
                                                  owner, CardModifier.Upper, CardRarity.Starter, CardTarget.Enemy)
 {
 }
Пример #14
0
 public virtual void Update(AbstractCharacter killer, AbstractCharacter killed)
 {
     if (killer.Equals(this))
     {
         PiedraEterna += 1;
     }
 }
Пример #15
0
 public Arashi(AbstractCharacter owner) : base("岚", owner.Weapon.Cost, owner.Weapon.Damage, 1, 1,
                                               "", new Dictionary <Keyword, int> {
     { Keyword.Deal, owner.Weapon.Damage }, { Keyword.OpponentDiscard, 1 }
 }, owner,
                                               CardModifier.Lower, CardRarity.Starter, CardTarget.Enemy)
 {
 }
Пример #16
0
 public Strike(AbstractCharacter owner) : base("Strike", 1, 4, 1, 0, "",
                                               new Dictionary <Keyword, int> {
     { Keyword.Deal, 4 }, { Keyword.Vulnerable, 1 }
 }, owner, CardModifier.Dash,
                                               CardRarity.Starter, CardTarget.Enemy)
 {
 }
Пример #17
0
    public void TakeDamage(AbstractCharacter invoker)
    {
        ICommand cmd = new AttackDamageCommand(invoker, _owner, _damage);

        cmd.Execute();
        DestroyProjectile();
    }
Пример #18
0
 public AbstractAttackCard(string name, int baseCost, int baseDamage, int baseMagicNumber, int bonusCost,
                           string img, Dictionary <Keyword, int> keywords, AbstractCharacter owner, CardModifier modifier, CardRarity rarity,
                           CardTarget target)
     : base(name, baseCost, bonusCost, baseDamage, baseMagicNumber, img, keywords, owner,
            CardType.Attack, modifier, rarity, target)
 {
 }
Пример #19
0
 public override void OnUse(AbstractCharacter source, AbstractCharacter target)
 {
     // 追加连击
     base.OnUse(source, source);
     AddToBot(new DamageAction(source, target, this, Damage));
     // 执行相应动画
 }
Пример #20
0
 public override void Play(AbstractCharacter source, AbstractArgument target)
 {
     base.Play(source, target);
     EventSystemManager.Instance.SubscribeToEvent(this, EventType.CARD_DRAWN);
     NegotiationManager.Instance.AddAction(new DrawCardsAction(source, DRAW));
     EventSystemManager.Instance.UnsubscribeFromAllEvents(this);
 }
Пример #21
0
        public override void PlayAction(AbstractCharacter character)
        {
            if (player.WeaponSlot.GetComponent <AbstractItem>() != null)
            {
                playersweapon = player.WeaponSlot.GetComponent <AbstractItem>();
            }

            if (Inventory_System.InventorySystem.Instance.WeaponSlot.GetComponent <AbstractItem>() != null)
            {
                inventoryweapon = Inventory_System.InventorySystem.Instance.WeaponSlot.GetComponent <AbstractItem>();
            }

            if (playersweapon != null)
            {
                player.GetComponent <EquipmentComponent>().UnEquipWeapon();
                CopyComponent(playersweapon, Inventory_System.InventorySystem.Instance.WeaponSlot);
                playersweapon.Destroythis();
            }
            if (inventoryweapon != null)
            {
                player.GetComponent <EquipmentComponent>().EquipWeapon(inventoryweapon as IWeapon);
                CopyComponent(inventoryweapon, (player.WeaponSlot));
                inventoryweapon.Destroythis();
            }

            actionEnded?.Invoke(this, null);
        }
Пример #22
0
    public override void Play(AbstractCharacter source, AbstractCharacter target)
    {
        base.Play(source, target);
        int damageRoll = minDamage + Random.Range(0, bonusDamage + 1);

        CombatManager.Instance.AddAction(new DamageTargetAction(source, target, damageRoll));
    }
Пример #23
0
        public DamageAction(AbstractCharacter source, AbstractCharacter target, AbstractCard card, int damage)
            : base(source, target, card)
        {
            var percent = 100 + source.DealDamagePercent() + target.TakeDamagePercent();

            Damage = percent * damage;
        }
Пример #24
0
 /// <summary>
 /// Crea un nuevo encuentro de intercambio entre dos personajes y una lista de items.
 /// </summary>
 /// <param name="sharer">El personaje a ceder los items.</param>
 /// <param name="receiver">El personaje a recibir los items.</param>
 /// <param name="items">Los items a intercambiar.</param>
 public ExchangeEncounter(AbstractCharacter sharer, AbstractCharacter receiver, List <AbstractItem> items)
 {
     Sharer   = sharer;
     Receiver = receiver;
     Items    = items;
     Logger   = RpCore.Instance.Logger;
 }
Пример #25
0
 public override void Play(AbstractCharacter source, AbstractArgument target)
 {
     base.Play(source, target);
     temp = source;
     NegotiationManager.Instance.AddAction(new DamageAction(target, target.OWNER, MIN_DAMAGE, MAX_DAMAGE, this));
     NegotiationManager.Instance.SelectCardsFromList(source.GetDiscardPile().ToList(), 1, true, this);
 }
Пример #26
0
 public override void NotifyOfEvent(AbstractEvent eventData)
 {
     if (eventData.type == EventType.POISE_APPLIED)
     {
         EventPoiseApplied data = (EventPoiseApplied)eventData;
         if (data.target.OWNER == this.OWNER)
         {
             NegotiationManager.Instance.AddAction(new AddStacksToArgumentAction(this, 1));
         }
     }
     else if (eventData.type == EventType.TURN_END)
     {
         EventTurnEnd data = (EventTurnEnd)eventData;
         if (data.end == this.OWNER)
         {
             NegotiationManager.Instance.AddAction(new DestroyArgumentAction(this));
         }
     }
     else if (eventData.type == EventType.ARGUMENT_DESTROYED)
     {
         EventArgDestroyed data = (EventArgDestroyed)eventData;
         if (data.argumentDestroyed == this)
         {
             AbstractCharacter enemy = TurnManager.Instance.GetOtherCharacter(this.OWNER);
             NegotiationManager.Instance.AddAction(new DamageAction(null, enemy, this.stacks, this.stacks, this));
         }
     }
 }
Пример #27
0
 // A bunch of checks to make sure that we can even play the card -- if we're not able to, don't activate card effects.
 public virtual void Play(AbstractCharacter source, AbstractArgument target)
 {
     if (!source.canPlayCards)
     {
         throw new Exception(source.NAME + " cannot play cards!");
     }
     if ((this.IsAttack() && !source.canPlayAttacks) || (this.IsSkill() && !source.canPlaySkills) || (this.IsTrait() && !source.canPlayTraits))
     {
         throw new Exception(source.NAME + " cannot play card of type " + this.TYPE.ToString());
     }
     if ((this.IsDialogue() && !source.canPlayDialogue) || (this.IsAggression() && !source.canPlayAggression) || (this.IsInfluence() && !source.canPlayInfluence))
     {
         throw new Exception(source.NAME + " cannot play card of type " + this.AMBIENCE.ToString());
     }
     if (source.curAP < this.COST)
     {
         throw new Exception(source.NAME + " does not have enough actions to play " + this.NAME);
     }
     // if (this.HasTag(CardTags.DESTROY)){         // Destroy card
     //     this.OWNER.Destroy(this);
     // } else if (this.IsTrait() || this.HasTag(CardTags.SCOUR)){               // Scour stuff
     //     this.OWNER.Scour(this);
     // } else {
     //     if (this.OWNER.GetHand().Contains(this)){           // This check is to prevent adding cards from "choice" mechanics from being added to the discard (see: Deckard's Instincts card)
     //         this.OWNER.GetHand().Remove(this);
     //         this.OWNER.GetDiscardPile().AddCard(this);
     //     }
     // }
 }
Пример #28
0
    public override void Play(AbstractCharacter source, AbstractCharacter target)
    {
        base.Play(source, target);
        List <AbstractCard> improve = CombatManager.Instance.SelectCardsFromList(source.GetHand(), 1, true);

        improve[0].COST += increaseCost;
    }
Пример #29
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        int multiplier = 1 + source.GetSupportArguments().Count;     // 1 for core argument

        NegotiationManager.Instance.AddAction(new DamageAction(target, target.OWNER, MIN_DAMAGE * multiplier, MAX_DAMAGE * multiplier, this));
    }
Пример #30
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        int dbl = (doubleDmg) ? 2 : 1;

        NegotiationManager.Instance.AddAction(new DamageAction(target, target.OWNER, MIN_DAMAGE * dbl, MAX_DAMAGE * dbl, this));
    }
Пример #31
0
    public virtual void Start()
    {
        invicible = true;

        explosionPrefabGo = Resources.Load("Explosion") as GameObject;
        if (isPlayer) mainCharacter = this;
        moveComponent = GetComponent<MoveComponent>();
        fireComponent = GetComponent<FireComponent>();
        aiComponent = GetComponent<AIComponent>();
    }
Пример #32
0
 //誰かが乗っているか(タイプ指定)
 public virtual bool isCharacterOn(AbstractCharacter.Type type)
 {
     foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Character"))
     {
         if (checkZeroDistance(obj))
         {
             if (obj.GetComponent<AbstractCharacter>().type == type)
             {
                 character = obj;
                 return true;
             }
         }
     }
     return false;
 }