public override void Init(GameManager manager) { base.Init(manager); stateMachine = CreateSubComponent <BattleStateMachine>(); characters = CreateSubComponent <CharacterManager>(); stat = CreateSubComponent <BattleStatistics>(); }
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); }
private void CreateNonMonobehaviours() { units = new Units(); simulator = new BattleSimulator(); rule = new BattleRuleLastTeam(); statistics = new BattleStatistics(); saveLoad = new BattleSaveLoad(); }
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(); }
public static StatisticsResponse ToRest(this BattleStatistics statistics) { return(new StatisticsResponse() { Destroyed = statistics.Destroyed, Knocked = statistics.Knocked, ShipCount = statistics.ShipCount, ShotCount = statistics.ShotCount }); }
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; }
private void InitializeBattleStatisticOnGameStart() { battleStatistics = new BattleStatistics(statisticsLevelUpdater, characterInformation); battleStatistics.InitializeBattleStatisics(basicStatsUIView, duelStatsUIView); Debug.Log(battleStatistics); }
//-------------------------统计数据------------------------- public void InitStatistics() { effectStat = new EffectStatistics(); roundStat = new RoundStatistics(); battleStat = new BattleStatistics(); }
public static UserHeroData UpdateHeroesStatistics(this UserHeroData heroData, IEnumerable <int> heroIds, BattleStatistics statistics) => default;
void Awake() { inst = this; }
public GameStopByWinRequest(int winnerClientId, BattleStatistics battleStatistics) { WinnerClientId = winnerClientId; BattleStatistics = battleStatistics; }
public override void Deserialize(DataStream reader) { base.Deserialize(reader); WinnerClientId = reader.ReadSInt32(); BattleStatistics = BattleStatistics.Deserialize(reader); }