コード例 #1
0
    // Clean up should be done in the EndNegotiationLost/EndNegotiationWon functions.
    // Get the player and enemy from the turn manager. Deep-copy their permadecks to their draw pile.
    public void StartNegotiation(RenderNegotiation renderer, AbstractEnemy enemyChar, RewardType rewardsOnWin = RewardType.NORMAL)
    {
        this.player       = (GameState.mainChar == null) ? new PlayerDeckard() : GameState.mainChar; // null check for player - if null, use Deckard as base
        this.enemy        = (enemyChar == null) ? new TestEnemy() : this.enemy;                      // null check for enemy - if null, use TestEnemy as base
        this.rewardsOnWin = rewardsOnWin;
        tm.AddToTurnList(player);
        tm.AddToTurnList(enemy);

        this.renderer = renderer;

        em.ClearAllSubscribers();
        em.SubscribeToEvent(this, EventType.CARD_PLAYED);        // Subscribe to CARD_PLAYED event to perform all post-card play processing (ambience shift, adjusting global values, etc.)
        em.SubscribeToEvent(this, EventType.ARGUMENT_DESTROYED); // Subscribe to ARGUMENT_DESTROYED event to perform enemy intent recalculations whenever an argument is destroyed

        Debug.Log("NegotiationManager.cs: Performing deep copy of deck contents for enemy and player.");
        DeepCopyDeck(player);
        DeepCopyDeck(enemy);

        this.player.curAP             = player.maxAP;
        this.enemy.curAP              = enemy.maxAP;
        this.enemy.coreArgument.curHP = this.enemy.coreArgument.maxHP;

        player.Draw(5);
        enemy.Draw(5);

        player.coreArgument.TriggerOnDeploy();
        enemy.coreArgument.TriggerOnDeploy();
        em.TriggerEvent(new EventTurnStart(tm.GetCurrentCharacter()));

        Debug.Log("Negotiation begins!");

        enemy.CalculateIntents();
        // foreach(EnemyIntent intent in enemy.intents){
        //     Debug.Log($"The enemy intends to play {intent.cardToPlay} on {intent.argumentTargeted}");
        // }
    }