Пример #1
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));
    }
Пример #2
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));
    }
Пример #3
0
    public override int Resolve()
    {
        AbstractArgument instance = owner.GetArgument(argumentToDestroy);

        if (instance != null)
        {
            if (destroyedByThisCard != null)
            {
                EventSystemManager.Instance.TriggerEvent(new EventArgDestroyed(argumentToDestroy, destroyedByThisCard));
            }
            else if (destroyedByThisArgument != null)
            {
                EventSystemManager.Instance.TriggerEvent(new EventArgDestroyed(argumentToDestroy, destroyedByThisArgument));
            }
            else
            {
                EventSystemManager.Instance.TriggerEvent(new EventArgDestroyed(argumentToDestroy)); // trigger on-destroy effects (if any on the argument itself or on the destroying card/arg)
            }
            this.argumentToDestroy.TriggerOnDestroy();                                              // Remove event subscriptions and handle victory/defeat if a core argument was destroyed

            owner.GetSupportArguments().Remove(this.argumentToDestroy);                             // remove argument from the list of arguments (previous line will return if it's a core argument so no worries)
            // Remove all actions that were in the action queue and associated w/ the destroyed argument
            NegotiationManager.Instance.actionQueue.RemoveAll(action => action.origin == instance);
        }
        return(0);
    }
Пример #4
0
    public void RenderNonCoreArguments()
    {
        Transform parent = GameObject.Find("Canvas/PlayerSide/SpawnNonCoreHere").transform;

        foreach (Transform child in parent)
        {
            if (child.gameObject.GetComponent <DisplayArgument>())
            {
                GameObject.Destroy(child.gameObject.GetComponent <DisplayArgument>().tooltipInstance);
            }
            GameObject.Destroy(child.gameObject);
        }

        for (int i = 0; i < player.GetSupportArguments().Count; i++)
        {
            float   angle  = ((i + 1) * Mathf.PI * 2f) / 10; // 10 should be a placeholder number
            Vector3 newPos = new Vector3(parent.position.x + Mathf.Cos(angle) * radius, parent.position.y + Mathf.Sin(angle) * radius, 0);

            GameObject arg = Instantiate(argPrefab, newPos, Quaternion.identity);
            arg.GetComponent <DisplayArgument>().reference = player.GetSupportArguments()[i];
            arg.transform.SetParent(parent);
            arg.SetActive(true);
        }

        parent = GameObject.Find("Canvas/EnemySide/SpawnNonCoreHere").transform;
        foreach (Transform child in parent)
        {
            if (child.gameObject.GetComponent <DisplayArgument>())
            {
                GameObject.Destroy(child.gameObject.GetComponent <DisplayArgument>().tooltipInstance);
            }
            GameObject.Destroy(child.gameObject);
        }

        for (int i = 0; i < enemy.GetSupportArguments().Count; i++)
        {
            float   angle  = ((i + 1) * Mathf.PI * 2f) / 10; // 10 should be a placeholder number
            Vector3 newPos = new Vector3(parent.position.x + Mathf.Cos(angle) * radius, parent.position.y + Mathf.Sin(angle) * radius, 0);

            GameObject arg = Instantiate(argPrefab, newPos, Quaternion.identity);
            arg.GetComponent <DisplayArgument>().reference = enemy.GetSupportArguments()[i];
            arg.transform.SetParent(parent);
            arg.SetActive(true);
        }
    }
Пример #5
0
 public override void Play(AbstractCharacter source, AbstractArgument target)
 {
     base.Play(source, target);
     NegotiationManager.Instance.AddAction(new DamageAction(target, target.OWNER, MIN_DAMAGE, MAX_DAMAGE, this));
     foreach (AbstractArgument support in source.GetSupportArguments())
     {
         NegotiationManager.Instance.AddAction(new AddStacksToArgumentAction(support, this.STACKS));
     }
 }
Пример #6
0
 public override void Play(AbstractCharacter source, AbstractArgument target){
     base.Play(source, target);
     int cnt = 0;
     foreach(AbstractArgument argument in source.GetSupportArguments()){
         if (argument.NAME.Contains("Talisman")){
             cnt++;
         }
     }
     NegotiationManager.Instance.AddAction(new DamageAction(target, target.OWNER, MIN_DAMAGE + cnt, MAX_DAMAGE + cnt, this));
 }
Пример #7
0
 // post-negotiation cleanup helper function
 public void Cleanup(AbstractCharacter character)
 {
     actionQueue.Clear();
     character.coreArgument.poise = 0;
     character.GetHand().Clear();
     character.GetSupportArguments().Clear();
     character.GetDrawPile().Clear();
     character.GetDiscardPile().Clear();
     character.GetScourPile().Clear();
 }
Пример #8
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        int bonus = 0;
        List <AbstractArgument> arguments = source.GetSupportArguments();

        for (int i = 0; i < arguments.Count; i++)
        {
            bonus += arguments[i].stacks;
        }
        NegotiationManager.Instance.AddAction(new DamageAction(target, target.OWNER, MIN_DAMAGE + bonus, MAX_DAMAGE + bonus, this));
    }
Пример #9
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        int poiseToSteal = target.poise;

        target.poise = 0;
        NegotiationManager.Instance.AddAction(new ApplyPoiseAction(source, source.GetCoreArgument(), poiseToSteal));
        if (this.isUpgraded)
        {
            foreach (AbstractArgument arg in source.GetSupportArguments())
            {
                NegotiationManager.Instance.AddAction(new ApplyPoiseAction(source, arg, poiseToSteal));
            }
        }
    }