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));
    }
示例#2
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);

        NegotiationManager.Instance.AddAction(new ApplyPoiseAction(source, source.GetCoreArgument(), POISE));
        NegotiationManager.Instance.AddAction(new ApplyPoiseAction(source, source.GetCoreArgument(), 2, true));

        foreach (AbstractArgument arg in source.GetTargetableArguments())
        {
            NegotiationManager.Instance.AddAction(new ApplyPoiseAction(source, arg, POISE));
            NegotiationManager.Instance.AddAction(new ApplyPoiseAction(source, arg, 2, true));
        }
    }
    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));
    }
示例#4
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);
    }
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        int poiseSum = 0;

        poiseSum += source.GetCoreArgument().poise;
        foreach (AbstractArgument arg in source.GetTargetableArguments())
        {
            poiseSum += arg.poise;
        }
        poiseSum = (int)Mathf.Round((float)0.5 * poiseSum);
        NegotiationManager.Instance.AddAction(new DamageAction(target, target.OWNER, MIN_DAMAGE + poiseSum, MAX_DAMAGE + poiseSum, this));
    }
示例#6
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        NegotiationManager.Instance.AddAction(new DrawCardsAction(source, DRAW));
        if (this.isUpgraded)
        {
            NegotiationManager.Instance.AddAction(new ApplyPoiseAction(source, source.GetCoreArgument(), POISE));

            foreach (AbstractArgument arg in source.GetTargetableArguments())
            {
                NegotiationManager.Instance.AddAction(new ApplyPoiseAction(source, arg, POISE));
            }
        }
    }
示例#7
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));
            }
        }
    }
示例#8
0
    // Called whenever we load into the Negotiation scene.
    void Start()
    {
        Debug.Log("RenderNegotiation calls NegotiationManager's StartNegotiation()");

        nm.StartNegotiation(this, null);  // Start negotiation! (This also sets up a whole bunch of gameobjects in nm that we can now use for this method)

        mainCamera         = Camera.main; // grab main camera
        handZone           = GameObject.Find("Canvas/HandZone");
        argPrefab          = Resources.Load("Prefabs/ArgumentDisplay") as GameObject;
        cardTemplatePrefab = Resources.Load("Prefabs/CardTemplate") as GameObject;
        intentPrefab       = Resources.Load("Prefabs/IntentDisplay") as GameObject;

        drawCount    = GameObject.Find("Canvas/TrackDeck/Count").GetComponent <TextMeshProUGUI>();
        discardCount = GameObject.Find("Canvas/TrackDiscard/Count").GetComponent <TextMeshProUGUI>();
        scourCount   = GameObject.Find("Canvas/TrackScour/Count").GetComponent <TextMeshProUGUI>();
        actionCount  = GameObject.Find("Canvas/TrackAP/Count").GetComponent <TextMeshProUGUI>();
        scourObject  = GameObject.Find("Canvas/TrackScour");
        scourObject.SetActive(false);
        endTurnButton = GameObject.Find("Canvas/EndTurnButton").GetComponent <Button>();
        endTurnButton.onClick.AddListener(NegotiationManager.Instance.NextTurn);

        roundText = GameObject.Find("Canvas/EndTurnButton/TurnCounter").GetComponent <TextMeshProUGUI>();

        player = nm.player;
        enemy  = nm.enemy;

        // Render core arguments
        GameObject corePlayer = Instantiate(argPrefab, GameObject.Find("Canvas/PlayerSide/SpawnCoreHere").transform.position, Quaternion.identity);

        corePlayer.GetComponent <DisplayArgument>().reference = player.GetCoreArgument();
        corePlayer.transform.SetParent(GameObject.Find("Canvas/PlayerSide/SpawnCoreHere").transform);
        corePlayer.SetActive(true);     // Invoke the core argument's OnEnable() function since the prefab is disabled by default

        GameObject coreEnemy = Instantiate(argPrefab, GameObject.Find("Canvas/EnemySide/SpawnCoreHere").transform.position, Quaternion.identity);

        coreEnemy.GetComponent <DisplayArgument>().reference = enemy.GetCoreArgument();
        coreEnemy.transform.SetParent(GameObject.Find("Canvas/EnemySide/SpawnCoreHere").transform);
        coreEnemy.SetActive(true);

        // this.RenderHand();  // Render player hand
        // this.RenderCounts();
        Redraw();
    }
示例#9
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        AmbienceState state = NegotiationManager.Instance.ambience.GetState();

        if (target.isCore || target.OWNER != this.OWNER)
        {
            throw new System.Exception("You must target friendly support arguments with Interrogate!");
        }
        int damageToDeal        = target.stacks * MULTIPLIER;
        AbstractCharacter enemy = TurnManager.Instance.GetOtherCharacter(target.OWNER);

        // Destroy sacrifical argument
        NegotiationManager.Instance.AddAction(new DestroyArgumentAction(target));

        // Damage enemy arguments
        NegotiationManager.Instance.AddAction(new DamageAction(enemy.GetCoreArgument(), enemy, damageToDeal, damageToDeal, this));
        NegotiationManager.Instance.AddAction(new DeployArgumentAction(this.OWNER, new ArgumentAmbientShiftAggression(), INFLUENCE));
    }
示例#10
0
    public override void Play(AbstractCharacter source, AbstractArgument target)
    {
        base.Play(source, target);
        NegotiationManager.Instance.AddAction(new DamageAction(target.OWNER.GetCoreArgument(), target.OWNER, MIN_DAMAGE, MAX_DAMAGE, this));
        List <AbstractArgument> nonCoreArgs = target.OWNER.GetTargetableArguments();

        foreach (AbstractArgument arg in nonCoreArgs)
        {
            NegotiationManager.Instance.AddAction(new DamageAction(arg, arg.OWNER, MIN_DAMAGE, MAX_DAMAGE, this));
        }

        AbstractCharacter otherCharacter = TurnManager.Instance.GetOtherCharacter(target.OWNER);

        NegotiationManager.Instance.AddAction(new DamageAction(otherCharacter.GetCoreArgument(), otherCharacter, MIN_DAMAGE, MAX_DAMAGE, this));
        nonCoreArgs = otherCharacter.GetTargetableArguments();
        foreach (AbstractArgument arg in nonCoreArgs)
        {
            NegotiationManager.Instance.AddAction(new DamageAction(arg, arg.OWNER, MIN_DAMAGE, MAX_DAMAGE, this));
        }
    }
示例#11
0
    public override void NotifyOfEvent(AbstractEvent eventData)
    {
        int poiseToApply = 0;

        // need to cast to access "damageDealt" field
        if (eventData.type == EventType.ARGUMENT_ATTACKED_BLOCKED)
        {
            EventArgAttackedBlocked data = eventData as EventArgAttackedBlocked;
            poiseToApply = data.damageDealt;
        }
        else
        {
            EventArgAttackedUnblocked data = eventData as EventArgAttackedUnblocked;
            poiseToApply = data.damageDealt;
        }
        NegotiationManager.Instance.AddAction(new ApplyPoiseAction(charToApplyPoiseTo, charToApplyPoiseTo.GetCoreArgument(), poiseToApply));
        foreach (AbstractArgument arg in charToApplyPoiseTo.GetTargetableArguments())
        {
            NegotiationManager.Instance.AddAction(new ApplyPoiseAction(charToApplyPoiseTo, arg, poiseToApply));
        }
    }
示例#12
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));
     NegotiationManager.Instance.AddAction(new ApplyPoiseAction(source, source.GetCoreArgument(), POISE));
 }