private static PartyInfo MakePartyInfo(BtlCtrlParty btlCtrlParty) { HeroInfo heroInf01 = null; List <CharInfo> charInfoes01 = new List <CharInfo>(); List <BtlCtrlCharacter> characterList = btlCtrlParty.GetCharacters(); foreach (BtlCtrlCharacter ch in characterList) { if (ch.type == BtlCtrlCharacter.Type.Hero) { heroInf01 = MakeCharatcerInfo(ch, true) as HeroInfo; } else { charInfoes01.Add(MakeCharatcerInfo(ch, false)); } } //Secrets List <Divine.Secret> secrets = new List <Divine.Secret>(2) { Divine.Secret.Mirror, Divine.Secret.Ransom }; return(new PartyInfo(heroInf01, charInfoes01.ToArray(), secrets, 0, btlCtrlParty.partyName)); }
private void OnActionPointChanged(BtlCtrlParty party, int changedValue) { if (party.teamType == TeamTypes.Player && changedValue > 0) { _currentGeneratedAP += changedValue; } }
public void DestoryCharacter() { for (int i = 0; i < spells.Count; i++) { spells[i].Event_SpellFinished -= OnSpellFinished; spells[i].Event_ActionGenerated -= OnActionGenerated; } _relatedParty = null; _spells.Clear(); _spells = null; _stats = null; }
//Public Methods public void Init(List <BtlCtrlCharacter> playerCharacters, List <BtlCtrlCharacter> aiCharacters, string playerName, string aiName, List <long> turns, BattleControllerType type, int turnTime = 0, BattleSceneType sceneType = BattleSceneType.Tutorial_Hell) { _parties = new BtlCtrlParty[2]; _parties[0] = new BtlCtrlParty(); _parties[0].Init(playerCharacters, TeamTypes.Player, playerName); _parties[1] = new BtlCtrlParty(); _parties[1].Init(aiCharacters, TeamTypes.Enemy, aiName); ListenToPartiesAndCharactersEvents(); _turnOrders = turns; _turnTime = turnTime; _type = type; _sceneType = sceneType; _currentState = States.WaitToStartFight; _currentTurnIndex = -1; _currentActionsStack = new Stack <ActionData>(); _currentActiveSpells = new List <BtlCtrlSpell>(); _externalLogic = null; SetExternalLogic(); _secretController = new BtlCtrlSecretController(); _secretController.Event_ActionGenerated += OnActionGenerated; _fakeServer = FakeServer.instance; _fakeServer.Event_OnMove += OnMove; _fakeServer.Event_OnReadyCome += OnReadyCome; }
public void SetRelatedParty(BtlCtrlParty btlCtrlParty) { _relatedParty = btlCtrlParty; }