protected override void Awake() { Statistics = new StatisticSystem(new AttributeSet(AttributeType.Ap_i, (float)initialActionPoint, AttributeType.Hp_i, (float)initialHealth, AttributeType.Vr_i, 1000f)); onStatisticChange = Statistics.onStatisticChange; onStatusEffectChange = Statistics.onStatusEffectChange; base.Awake(); }
private Player(int id, int maxHp, int power, int dexterity, int wisdom) { this.id = id; talents.Add(AttributeType.WalkSpeed_c0, 0.8f); talents.Add(AttributeType.JumpPower_c0, 150); talents.Add(AttributeType.MaxHp_c0, 10); talents.Add(AttributeType.CriticalChance_cp0, 0.05f); talents.Add(AttributeType.CriticalDamage_cp0, 1.5f); talents.Add(AttributeType.BaseDamage_cp0, 1); talents.Add(AttributeType.AttackSpeed_cp0, 1); inventory = new Inventory(); inventory.Add(1, 1); inventory.Add(2, 1); inventory.Add(3, 1); stats = new StatisticSystem(talents, inventory); stats[StatisticType.Hp] = stats[StatisticType.MaxHp]; stats.onStatisticChange.AddListener(DispatchStatisticChangeEvents); OnWalkSpeedChange = new EventOnDataChange2 <float>(); OnJumpPowerChange = new EventOnDataChange2 <float>(); OnHpChange = new EventOnDataChange2 <float>(); OnCriticalChanceChange = new EventOnDataChange2 <float>(); OnCriticalDamageChange = new EventOnDataChange2 <float>(); OnBaseDamageChange = new EventOnDataChange2 <float>(); OnAttackSpeedChange = new EventOnDataChange2 <float>(); playerClass = 0; level = 1; exp = 0; neededExp = 100; this.maxHp = maxHp; this.power = power; this.dexterity = dexterity; this.wisdom = wisdom; OnLevelChange = new EventOnDataChange1 <int>(); OnExpChange = new EventOnDataChange2 <int>(); OnNeededExpChange = new EventOnDataChange1 <int>(); OnPromotionChange = new EventOnDataChange1 <int>(); OnPowerChange = new EventOnDataChange1 <int>(); OnDexterityChange = new EventOnDataChange1 <int>(); OnWisdomChange = new EventOnDataChange1 <int>(); }
private void OnGUI() { GUI.BeginGroup(new Rect(10f, Screen.height - 180f, 150f, 150f)); GUILayout.BeginVertical(); GUILayout.Label("In game: " + StatisticSystem.InGame); GUILayout.Label("Started: " + StatisticSystem.Started); GUILayout.Label("Missed: " + StatisticSystem.Missed); GUILayout.Label("Canceled: " + StatisticSystem.Canceled); GUILayout.Label("Collisions: " + StatisticSystem.Collisions); if (GUILayout.Button("Reset")) { StatisticSystem.Reset(); } GUILayout.EndVertical(); GUI.EndGroup(); }
protected virtual void Awake() { data = DataTableManager.singleton.GetEnemyData(typeID); rb2d = GetComponent <Rigidbody2D>(); defaultDrag = rb2d.drag; defaultMass = rb2d.mass; statistics = new StatisticSystem(data.Attributes, statusModifiers); statistics[StatisticType.Hp] = statistics[StatisticType.MaxHp]; if (fsm) { fsm = fsm.Initialize(this); } }
//private bool isDetectionHighlighted = false; //private HashSet<Tile> detectionArea = new HashSet<Tile>(); //public HashSet<Tile> DetectionArea //{ // get // { // return detectionArea; // } //} protected override void Awake() { Statistics = new StatisticSystem(new AttributeSet(AttributeType.Ap_i, (float)initialActionPoint, AttributeType.Hp_i, (float)initialHealth, AttributeType.Dr_i, (float)detectionRange, AttributeType.Ar_i, (float)attackRange)); onStatisticChange = Statistics.onStatisticChange; onStatusEffectChange = Statistics.onStatusEffectChange; //Player = LevelManager.Instance.Player; LevelManager.Instance.onGameEnd.AddListener(StopAllCoroutines); //GridManager.Instance.onUnitMove.AddListener(HandleDetection); base.Awake(); }
public void init() { player = Player.CurrentPlayer == null?Player.CreatePlayer() : Player.CurrentPlayer; statistics = new StatisticSystem(player.attributes, player.inventory); ResetStatistics(); OnStatisticChange = statistics.onStatisticChange; SpriteHolder.GetComponent <SpriteRenderer>().color = Color.white; rigidbody = GetComponent <Rigidbody2D>(); TimeManager.Instance.endSlowMotion(); fsm = fsm.Initialize(this); fsm.Boot(); //GUIManager.Singleton.Open("MainMenu", this); //StartDialogue(10102001); }