コード例 #1
0
 ///<summary>
 ///Trigger when an argument has stacks added to.
 ///</summary>
 public EventStatusEffectApplied(AbstractArgument argAppliedTo, AbstractStatusEffect effect, int stacks = 0)
 {
     this.type          = EventType.ARGUMENT_STATUS_EFFECT_APPLIED;
     this.argAppliedTo  = argAppliedTo;
     this.effectApplied = effect;
     this.stacksAdded   = stacks;
 }
コード例 #2
0
 ///<summary>
 ///Trigger when an argument has stacks added to.
 ///</summary>
 public EventArgStacksAdded(AbstractArgument argAddedTo, int stacks)
 {
     this.type            = EventType.ARGUMENT_STACKS_ADDED;
     this.argumentAddedTo = argAddedTo;
     this.stacksAdded     = stacks;
     this.newStackCount   = this.argumentAddedTo.stacks;
 }
コード例 #3
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));
    }
コード例 #4
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);
    }
コード例 #5
0
 public override void Play(AbstractCharacter source, AbstractArgument target)
 {
     NegotiationManager.Instance.AddAction(new ApplyStatusEffectAction(source, target, new StatusVulnerable()));
     NegotiationManager.Instance.AddAction(new ApplyStatusEffectAction(source, target, new StatusFortify()));
     // NegotiationManager.Instance.AddAction(new ApplyStatusEffectAction(source, target, new StatusSilenced()));
     NegotiationManager.Instance.AddAction(new ApplyStatusEffectAction(source, target, new StatusResonance()));
 }
コード例 #6
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);
     //     }
     // }
 }
コード例 #7
0
 public EnemyIntent(AbstractCard cardToPlay, AbstractArgument target)
 {
     this.cardToPlay       = cardToPlay;
     this.argumentTargeted = target;
     if (cardToPlay.TYPE == CardType.TRAIT)
     {
         this.intentType = IntentType.TRAIT;
     }
     else if (cardToPlay.TYPE == CardType.ATTACK)
     {
         this.intentType = IntentType.ATTACK;
     }
     else if (cardToPlay.TYPE == CardType.SKILL)
     {
         if (target.OWNER == cardToPlay.OWNER)
         {
             this.intentType = IntentType.BUFF_SKILL;
         }
         else
         {
             this.intentType = IntentType.DEBUFF_SKILL;
         }
     }
     else
     {
         this.intentType = IntentType.UNKNOWN;
     }
 }
コード例 #8
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));
    }
コード例 #9
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));
    }
コード例 #10
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));
        }
    }
コード例 #11
0
 ///<summary>
 ///Apply Poise to an argument. Damage to an argument is removed from Poise before its resolve.
 ///<list type="bullet">
 ///<item><term>src</term><description>The character applying the Poise.</description></item>
 ///<item><term>target</term><description>The argument receiving the Poise.</description></item>
 ///<item><term>poiseToApply</term><description>The amount of Poise to apply.</description></item>
 ///<item><term>multiply</term><description>Defaults to false. If true, poiseToApply is instead a multiplicative value and will multiply the amount of existing Poise on an argument (See DeckardCalm for an example).</description></item>
 ///</list>
 ///</summary>
 public ApplyPoiseAction(AbstractCharacter src, AbstractArgument target, int poiseToApply, bool multiply = false)
 {
     this.source   = src;
     this.target   = target;
     this.poise    = poiseToApply;
     this.multiply = multiply;
 }
コード例 #12
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);
 }
コード例 #13
0
    ///<returns>An integer of how many stacks were added.</returns>
    public override int Resolve()
    {
        AbstractArgument instance = this.owner.GetArgument(argumentToPlant);

        if (instance == null || this.plantNewCopy)
        {
            AbstractArgument newInstance = Activator.CreateInstance(this.argumentToPlant.GetType()) as AbstractArgument;
            newInstance.ORIGIN      = ArgumentOrigin.PLANTED;
            newInstance.OWNER       = this.owner;
            newInstance.stacks      = this.stacksToPlant;
            newInstance.INSTANCE_ID = newInstance.ID + "_" + NegotiationManager.Instance.argumentsDeployedThisNegotiation;
            NegotiationManager.Instance.argumentsDeployedThisNegotiation += 1;

            this.owner.GetSupportArguments().Add(newInstance);
            newInstance.TriggerOnDeploy();     // Add event subscriptions
            EventSystemManager.Instance.TriggerEvent(new EventArgCreated(newInstance));
        }
        else
        {
            Debug.Log("Copy exists; adding " + stacksToPlant + " stacks to it. Instance had " + instance.stacks + " stacks before adding these new ones.");
            NegotiationManager.Instance.AddAction(new AddStacksToArgumentAction(instance, stacksToPlant));
            Debug.Log("Instance now has " + instance.stacks + " stacks.");
        }
        return(this.stacksToPlant);
    }
コード例 #14
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));
    }
コード例 #15
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
 }
コード例 #16
0
 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
 }
コード例 #17
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);
 }
コード例 #18
0
    ///<summary>
    ///Apply a status effect to the argument.
    ///<list type="bullet">
    ///<item><term>src</term><description>The character applying the effect.</description></item>
    ///<item><term>target</term><description>The argument receiving the effect.</description></item>
    ///<item><term>effect</term><description>The effect to apply.</description></item>
    ///<item><term>stacksToApply</term><description>The number of stacks of the effect to apply. Defaults to 0, as most status effects don't use stacks.</description></item>
    ///</list>
    ///</summary>
    public ApplyStatusEffectAction(AbstractCharacter src, AbstractArgument target, AbstractStatusEffect effect, int stacksToApply = 0)
    {
        this.source = src;
        this.target = target;
        this.effect = effect;

        this.stacksToApply = stacksToApply;
    }
コード例 #19
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        int poiseToRemove = source.GetCoreArgument().poise;

        source.GetCoreArgument().poise = 0;
        NegotiationManager.Instance.AddAction(new DamageAction(target, target.OWNER, MIN_DAMAGE + poiseToRemove, MAX_DAMAGE + poiseToRemove, this));
    }
コード例 #20
0
 public override void Play(AbstractCharacter source, AbstractArgument target)
 {
     base.Play(source, target);
     for (int i = 0; i < INSTANCES; i++)
     {
         NegotiationManager.Instance.AddAction(new DeployArgumentAction(source, new ArgumentInsidiousWhispers(), STACKS, true));
     }
 }
コード例 #21
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        var rnd = new System.Random();
        List <AbstractCard> cards = source.GetDrawPile().deck.OrderBy(x => rnd.Next()).Take(CHOICES).ToList();       // Efficient? Not particularly. But draw piles will probably only ever range to at most 50 cards anyways.

        NegotiationManager.Instance.SelectCardsFromList(cards, 1, true, this);
    }
コード例 #22
0
 public override void Play(AbstractCharacter source, AbstractArgument target)
 {
     base.Play(source, target);
     foreach (AbstractArgument argument in source.GetTargetableArguments(true))
     {
         NegotiationManager.Instance.AddAction(new ApplyPoiseAction(source, argument, POISE));
     }
 }
コード例 #23
0
 public override void Play(AbstractCharacter source, AbstractArgument target)
 {
     base.Play(source, target);
     for (int i = 0; i < ITERATIONS; i++)
     {
         NegotiationManager.Instance.AddAction(new DamageAction(null, target.OWNER, MIN_DAMAGE, MAX_DAMAGE, this));
     }
 }
コード例 #24
0
    public void OnPointerEnter(PointerEventData eventData)
    {
        GameObject argumentObject = null;

        targetToDrawLineTo = reference.argumentTargeted;
        if (targetToDrawLineTo.OWNER.FACTION == FactionType.PLAYER)
        {
            if (targetToDrawLineTo.isCore)
            {
                argumentObject = GameObject.Find("PlayerSide/SpawnCoreHere/ArgumentDisplay(Clone)");
            }
            else
            {
                foreach (Transform nonCore in GameObject.Find("PlayerSide/SpawnNonCoreHere").transform)
                {
                    DisplayArgument displayArg = nonCore.gameObject.GetComponent <DisplayArgument>();
                    if (displayArg != null && displayArg.reference.INSTANCE_ID == targetToDrawLineTo.INSTANCE_ID)
                    {
                        argumentObject = displayArg.gameObject;
                        break;
                    }
                }
            }
        }
        else
        {
            if (targetToDrawLineTo.isCore)
            {
                argumentObject = GameObject.Find("EnemySide/SpawnCoreHere/ArgumentDisplay(Clone)");
            }
            else
            {
                foreach (Transform nonCore in GameObject.Find("EnemySide/SpawnNonCoreHere").transform)
                {
                    DisplayArgument displayArg = nonCore.gameObject.GetComponent <DisplayArgument>();
                    if (displayArg != null && displayArg.reference.INSTANCE_ID == targetToDrawLineTo.INSTANCE_ID)
                    {
                        argumentObject = displayArg.gameObject;
                        break;
                    }
                }
            }
        }

        if (argumentObject != null)
        {
            this.lr.enabled        = true;
            this.lr.sortingOrder   = 1;
            this.lr.material       = new Material(Shader.Find("Sprites/Default"));
            this.lr.material.color = Color.red;
            this.lr.SetPosition(0, Camera.main.ScreenToWorldPoint(transform.position) + new Vector3(0, 0, 10));
            this.lr.SetPosition(1, Camera.main.ScreenToWorldPoint(argumentObject.transform.position) + new Vector3(0, 0, 10));
        }
        prefabInstance = GameObject.Instantiate(cardTemplatePrefab, transform.position + new Vector3(0, 100, 0), Quaternion.identity);
        prefabInstance.transform.SetParent(this.transform);
        prefabInstance.GetComponent <DisplayCard>().reference = reference.cardToPlay;
        prefabInstance.GetComponent <DisplayCard>().Render();
    }
コード例 #25
0
 public override void Play(AbstractCharacter source, AbstractArgument target)
 {
     base.Play(source, target);
     if (target.isCore)
     {
         throw new Exception("Cannot target core arguments with cross-examination!");
     }
     NegotiationManager.Instance.AddAction(new DamageAction(target, target.OWNER, MIN_DAMAGE, MAX_DAMAGE, this));
 }
コード例 #26
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));
     }
 }
コード例 #27
0
    public override int Resolve()
    {
        // Set a random target if none exists.
        if (this.target == null)
        {
            int range = argumentOwner.GetTargetableArguments().Count + 1;
            int index = UnityEngine.Random.Range(0, range);
            if (index == 0)
            {
                this.target = argumentOwner.GetCoreArgument();
            }
            else
            {
                this.target = argumentOwner.GetTargetableArguments()[index - 1];
            }
        }
        int damageDealt = CalculateDamage(UnityEngine.Random.Range(damageMin, damageMax + 1));

        // Handle Poise removal.
        if (this.target.poise > 0 && !piercingDamage)
        {
            if ((damageDealt - this.target.poise) > 0)
            {
                damageDealt      -= this.target.poise;
                this.target.poise = 0;
            }
            else
            {
                this.target.poise -= damageDealt;
                EventSystemManager.Instance.TriggerEvent(new EventArgAttackedBlocked(target, damageDealt));
                return(damageDealt);
            }
        }


        this.target.curHP -= damageDealt;
        EventSystemManager.Instance.TriggerEvent(new EventArgAttackedUnblocked(target, damageDealt));


        // Check to see if the target argument should be destroyed.
        if (this.target.curHP <= 0)
        {
            if (attackingCard != null)
            {
                NegotiationManager.Instance.AddAction(new DestroyArgumentAction(target, attackingCard));
            }
            else if (attackingArgument != null)
            {
                NegotiationManager.Instance.AddAction(new DestroyArgumentAction(target, attackingArgument));
            }
            else
            {
                NegotiationManager.Instance.AddAction(new DestroyArgumentAction(target));
            }
        }
        return(0);
    }
コード例 #28
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        AmbienceState state        = Ambience.Instance.GetState();
        bool          bonusEffects = (state == AmbienceState.GUARDED);
        int           multiplier   = (bonusEffects) ? 2 : 1;

        NegotiationManager.Instance.AddAction(new ApplyPoiseAction(source, target, POISE * multiplier));
    }
コード例 #29
0
ファイル: AiRites.cs プロジェクト: ArtixBot/Paranormalize
 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));
 }
コード例 #30
0
 public override void Play(AbstractCharacter source, AbstractArgument target)
 {
     base.Play(source, target);
     if (target.isCore)
     {
         throw new Exception("Cannot target core arguments with Present the Evidence!");
     }
     NegotiationManager.Instance.AddAction(new AddStacksToArgumentAction(target, this.STACKS));
     NegotiationManager.Instance.AddAction(new DamageAction(null, TurnManager.Instance.GetOtherCharacter(target.OWNER), target.stacks, target.stacks, this));
 }