Beispiel #1
0
    public void StartDialogue(List <DialogueLine> dialogue, RelationshipRank rank, UnitPair pair)
    {
        gameObject.SetActive(true);

        sentences.Clear();
        names.Clear();

        this.rank = rank;
        this.pair = pair;

        if (rank != RelationshipRank.SPICY)
        {
            GameInformation.instance.SetBGMVolume(.3f);
        }
        else
        {
            GameInformation.instance.PlayLove();
        }

        SetDialogueUnits(dialogue);

        foreach (DialogueLine line in dialogue)
        {
            sentences.Enqueue(line.sentence);
            names.Enqueue(line.name);
        }

        lineNum = 1;
        DisplayNextSentence();
    }
    private RelationshipRank GetNearbyRelationship()
    {
        PlayerUnit playerUnit = GetComponent <PlayerUnit>();

        if (playerUnit == null)
        {
            return(RelationshipRank.NONE);
        }

        List <PlayerUnit> nearbyUnits = playerUnit.GetNearbyUnits();

        if (nearbyUnits.Count == 0)
        {
            return(RelationshipRank.NONE);
        }

        RelationshipRank rank = RelationshipRank.NONE;

        foreach (PlayerUnit unit in nearbyUnits)
        {
            RelationshipRank currentRank = RelationshipManager.GetRelationshipBetween(ID, unit.GetComponent <UnitStats>().ID).GetRank();
            if (currentRank > rank)
            {
                rank = currentRank;
            }
        }

        return(rank);
    }
    public int GetAttack(BoardCreator board, ItemData weapon)
    {
        RelationshipRank rank = GetNearbyRelationship();

        if (rank == RelationshipRank.NONE)
        {
            return(weapon.Damage);
        }

        return(weapon.Damage + Relationship.GetAttackBonus(rank));
    }
    public void Talk()
    {
        controller.ChangeState <BattleDialogueState>();
        controller.otherUnit = adjacentUnit;

        Relationship        r     = RelationshipManager.GetRelationshipBetween(currentUnit, adjacentUnit.GetComponent <UnitStats>().ID);
        RelationshipRank    rank  = r.GetNextRank();
        UnitPair            pair  = r.pair;
        List <DialogueLine> lines = BattleDialogue.GetBattleDialogueBetween(currentUnit, adjacentUnit.GetComponent <UnitStats>().ID);

        dialogueManager.StartDialogue(lines, rank, pair);
    }
Beispiel #5
0
    public Relationship(UnitPair pair)
    {
        this.pair = pair;

        rank          = RelationshipRank.NONE;
        supportPoints = 0;

        relationshipAttained = new Dictionary <RelationshipRank, bool>()
        {
            { RelationshipRank.CRUDE, false },
            { RelationshipRank.BLAND, false },
            { RelationshipRank.APPETIZING, false },
            { RelationshipRank.SPICY, false }
        };
    }
Beispiel #6
0
    public static string AsString(RelationshipRank rank)
    {
        switch (rank)
        {
        case RelationshipRank.SPICY:
            return("S");

        case RelationshipRank.APPETIZING:
            return("A");

        case RelationshipRank.BLAND:
            return("B");

        case RelationshipRank.CRUDE:
            return("C");
        }
        return("");
    }
    public static List <DialogueLine> GetDialogueBetween(UnitID a, UnitID b)
    {
        RelationshipRank rank = RelationshipManager.GetRelationshipBetween(a, b).GetNextRank();
        UnitPair         pair = RelationshipManager.GetRelationshipPair(a, b);

        switch (pair)
        {
        case UnitPair.MINKEEVHALL:
            return(vhallMinkeeDialogue[rank]);

        case UnitPair.PHYNNEMINKEE:
            return(minkeePhynneDialogue[rank]);

        case UnitPair.VHALLPHYNNE:
            return(phynneVhallDialogue[rank]);
        }

        Debug.LogError("Couldn't find relationship between " + a + " and " + b);
        return(null);
    }
Beispiel #8
0
    public void StartDialogue(List <DialogueLine> dialogue, RelationshipRank rank, UnitPair pair)
    {
        gameObject.SetActive(true);

        sentences.Clear();
        names.Clear();

        this.rank = rank;
        this.pair = pair;

        SetDialogueUnits(dialogue);

        foreach (DialogueLine line in dialogue)
        {
            sentences.Enqueue(line.sentence);
            names.Enqueue(line.name);
        }

        lineNum = 1;
        DisplayNextSentence();
    }
Beispiel #9
0
 public static int GetAttackBonus(RelationshipRank r)
 {
     return(attackPerRank[r]);
 }
Beispiel #10
0
    public bool ReachedNextRelationship()
    {
        RelationshipRank nextRank = GetHighestRank();

        return(nextRank != rank);
    }
Beispiel #11
0
 public void FinishSupportConversation()
 {
     rank = GetHighestRank();
     relationshipAttained[rank] = true;
 }
Beispiel #12
0
 public void StartDialogue(List <DialogueLine> lines, RelationshipUI from, RelationshipRank rank, UnitPair pair)
 {
     dialogueManager.StartDialogue(lines, rank, pair);
     dialogueManager.fromUI = from;
     controller.ChangeState <DialogueState>();
 }