Exemplo n.º 1
0
 public override void Init(GameManager manager)
 {
     base.Init(manager);
     stateMachine = CreateSubComponent <BattleStateMachine>();
     characters   = CreateSubComponent <CharacterManager>();
     stat         = CreateSubComponent <BattleStatistics>();
 }
Exemplo n.º 2
0
    public static BattleStatistics Deserialize(DataStream reader)
    {
        BattleStatistics bsm = new BattleStatistics();

        bsm.Level = reader.ReadSInt32();

        bsm.TotalDamage  = reader.ReadSInt32();
        bsm.DamageToMech = reader.ReadSInt32();
        bsm.DamageToShip = reader.ReadSInt32();

        bsm.TotalInjury = reader.ReadSInt32();
        bsm.MechInjury  = reader.ReadSInt32();
        bsm.ShipInjury  = reader.ReadSInt32();

        bsm.TotalHeal = reader.ReadSInt32();
        bsm.MechHeal  = reader.ReadSInt32();
        bsm.ShipHeal  = reader.ReadSInt32();

        bsm.TotalSummon   = reader.ReadSInt32();
        bsm.SoldierSummon = reader.ReadSInt32();
        bsm.HeroSummon    = reader.ReadSInt32();

        bsm.FinalHealth      = reader.ReadSInt32();
        bsm.FinalHealthRatio = (float)reader.ReadSInt32() / 1000;

        bsm.TotalKill   = reader.ReadSInt32();
        bsm.SoldierKill = reader.ReadSInt32();
        bsm.HeroKill    = reader.ReadSInt32();

        bsm.TotalLost   = reader.ReadSInt32();
        bsm.SoldierLost = reader.ReadSInt32();
        bsm.HeroLost    = reader.ReadSInt32();

        bsm.Draws  = reader.ReadSInt32();
        bsm.Rounds = reader.ReadSInt32();

        bsm.TotalGetEnergy = reader.ReadSInt32();
        bsm.TotalUseEnergy = reader.ReadSInt32();
        bsm.TotalUseMetal  = reader.ReadSInt32();

        bsm.UseCards                            = reader.ReadSInt32();
        bsm.UseCards_Mech                       = reader.ReadSInt32();
        bsm.UseCards_Soldier                    = reader.ReadSInt32();
        bsm.UseCards_Hero                       = reader.ReadSInt32();
        bsm.UseCards_Equipment                  = reader.ReadSInt32();
        bsm.UseCards_Equipment_Weapon           = reader.ReadSInt32();
        bsm.UseCards_Equipment_Weapon_Sword     = reader.ReadSInt32();
        bsm.UseCards_Equipment_Weapon_Gun       = reader.ReadSInt32();
        bsm.UseCards_Equipment_Weapon_SniperGun = reader.ReadSInt32();
        bsm.UseCards_Equipment_Shield           = reader.ReadSInt32();
        bsm.UseCards_Equipment_Shield_Armor     = reader.ReadSInt32();
        bsm.UseCards_Equipment_Shield_Shield    = reader.ReadSInt32();
        bsm.UseCards_Equipment_Shield_Mixed     = reader.ReadSInt32();
        bsm.UseCards_Equipment_Pack             = reader.ReadSInt32();
        bsm.UseCards_Equipment_MA               = reader.ReadSInt32();
        bsm.UseCards_Spell                      = reader.ReadSInt32();
        bsm.UseCards_Energy                     = reader.ReadSInt32();
        return(bsm);
    }
Exemplo n.º 3
0
 private void CreateNonMonobehaviours()
 {
     units      = new Units();
     simulator  = new BattleSimulator();
     rule       = new BattleRuleLastTeam();
     statistics = new BattleStatistics();
     saveLoad   = new BattleSaveLoad();
 }
Exemplo n.º 4
0
 public BattlePlayer(string username, int clientId, int metalLeft, int metalMax, int lifeLeft, int lifeMax, int energyLeft, int energyMax, GameManager serverGameManager) : base(username, metalLeft, metalMax, lifeLeft, lifeMax, energyLeft, energyMax)
 {
     ClientId            = clientId;
     GameManager         = serverGameManager;
     HandManager         = new Battle_HandManager(this);
     CardDeckManager     = new CardDeckManager(this);
     BattleGroundManager = new BattleGroundManager(this);
     BattleStatistics    = new BattleStatistics();
 }
Exemplo n.º 5
0
 public static StatisticsResponse ToRest(this BattleStatistics statistics)
 {
     return(new StatisticsResponse()
     {
         Destroyed = statistics.Destroyed,
         Knocked = statistics.Knocked,
         ShipCount = statistics.ShipCount,
         ShotCount = statistics.ShotCount
     });
 }
Exemplo n.º 6
0
    public BattleStatistics CombatStatistics()
    {
        //Instead when we need the battle stats we can call this function to run the calculation.
        //It will return a battle stats struct containing the calculated stats for us to use
        BattleStatistics stats = new BattleStatistics();

        //Just use the same calculations here but make them apart of the struct
        stats.attack      = unit.statistics.strength + equippedWeapon.might;
        stats.attackSpeed = unit.statistics.agility - ((unit.statistics.strength - equippedWeapon.weight) / 4);
        stats.protection  = unit.statistics.defense;    //plus any shield
        stats.resilience  = unit.statistics.resistance; //plus any shield
        stats.hit         = equippedWeapon.hit + (unit.statistics.proficiency / 2) + (unit.statistics.motivation / 4);
        stats.avoid       = stats.attackSpeed + unit.statistics.motivation / 5;
        stats.crit        = equippedWeapon.crit + (unit.statistics.proficiency / 2) + (unit.statistics.motivation / 5);
        stats.vigilance   = (unit.statistics.proficiency / 3) + (unit.statistics.motivation / 5);

        return(stats);
    }
 public StatisticsService(BattleStatistics battleStatistics, Game game)
 {
     _battleStatistics = battleStatistics;
     _game             = game;
 }
Exemplo n.º 8
0
 private void InitializeBattleStatisticOnGameStart()
 {
     battleStatistics = new BattleStatistics(statisticsLevelUpdater, characterInformation);
     battleStatistics.InitializeBattleStatisics(basicStatsUIView, duelStatsUIView);
     Debug.Log(battleStatistics);
 }
Exemplo n.º 9
0
 //-------------------------统计数据-------------------------
 public void InitStatistics()
 {
     effectStat = new EffectStatistics();
     roundStat  = new RoundStatistics();
     battleStat = new BattleStatistics();
 }
Exemplo n.º 10
0
 public static UserHeroData UpdateHeroesStatistics(this UserHeroData heroData, IEnumerable <int> heroIds, BattleStatistics statistics) => default;
 void Awake()
 {
     inst = this;
 }
Exemplo n.º 12
0
 public GameStopByWinRequest(int winnerClientId, BattleStatistics battleStatistics)
 {
     WinnerClientId   = winnerClientId;
     BattleStatistics = battleStatistics;
 }
Exemplo n.º 13
0
 public override void Deserialize(DataStream reader)
 {
     base.Deserialize(reader);
     WinnerClientId   = reader.ReadSInt32();
     BattleStatistics = BattleStatistics.Deserialize(reader);
 }