public void ShowRelationship(UnitID current, UnitID other) { UpdateButtons(); relationship = RelationshipManager.GetRelationshipBetween(current, other); otherUnit = GameInformation.instance.GetPlayerInfo(other); currentUnit = current; unitSprite.sprite = otherUnit.unitSprite; nameText.text = otherUnit.name; curr = -1; switch (relationship.GetRank()) { case RelationshipRank.CRUDE: curr = 0; break; case RelationshipRank.BLAND: curr = 1; break; case RelationshipRank.APPETIZING: curr = 2; break; case RelationshipRank.SPICY: curr = 3; break; } UpdateRelationships(); }
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 override void Exit() { RelationshipManager.GetRelationshipBetween(owner.currentUnit.GetComponent <UnitStats>().ID, owner.otherUnit.GetComponent <UnitStats>().ID); owner.currentUnit.PlayHeart(); owner.otherUnit.PlayHeart(); owner.otherUnit = null; }
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); }
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); }
public void IncreaseSupport() { PlayerUnit playerUnit = GetComponent <PlayerUnit>(); if (playerUnit == null) { return; } List <PlayerUnit> nearbyUnits = playerUnit.GetNearbyUnits(); foreach (PlayerUnit unit in nearbyUnits) { RelationshipManager.GetRelationshipBetween(ID, unit.GetComponent <UnitStats>().ID).IncreaseSupport(); unit.PlayHeart(); } if (nearbyUnits.Count > 0) { GetComponent <PlayerUnit>().PlayHeart(); } }