예제 #1
0
        // change owner param type to StatsSystemBehaviour since we REQUIRE it?
        // just init castCircle or also instantiate it here? think init fits more
        public virtual void Init(GameObject owner, StatsSystem statsSys, CooldownSystem cooldownSys
                                 , Guid id, Transform castCirclePlacement, CastPlaceholder castCircle, BaseSpellCastData data, SpellBase spellPrefab
                                 , params MonoBehaviour[] movementScripts)
        {
            // Debug.Log($"{owner} | NEXT: | {statsSys} | NEXT: | {cooldownSys} | NEXT: | {id} | NEXT: |" +
            //           $" {castCircle} | NEXT: | {data} | NEXT: | {spellPrefab} | NEXT: | {movementScripts.Length}");

            Owner   = owner;
            element = spellPrefab.SpellElement;

            this.id = id;
            this.movementScripts     = movementScripts.ToList();
            this.cooldownSys         = cooldownSys;
            this.statsSys            = statsSys;
            this.castCirclePlacement = castCirclePlacement;
            this.castCircle          = castCircle;
            this.spellPrefab         = spellPrefab;

            this.castCircle.onCastEnd += FinishSpellCast;
            castCircleAnimator         = castCircle.GetComponent <Animator>();

            Data = data;

            prevEnableStates = new bool[movementScripts.Length];

            InitTimer();
        }
 private void Start()
 {
     stats                      = statsSystem.GetComponent <StatsSystem>();
     stats.statPoints           = PlayerUnit.totalDamage + 2;
     stats.statPointsText.text  = stats.statPoints.ToString();
     stats.healthStatsText.text = PlayerUnit.currentHealth.ToString();
     stats.healthStat           = PlayerUnit.currentHealth;
 }
예제 #3
0
 // Start is called before the first frame update
 void Start()
 {
     Instance      = this;
     GameCharacter = GetComponent <GameCharacter>();
     Abilites      = GetComponent <AbilitesSystem>();
     Stats         = GetComponent <StatsSystem>();
     gridCombatSystem.OnPlayerRound += Grid_PlayerNewRound;
 }
예제 #4
0
        private void Awake()
        {
            statsSys = statsSysBehav.StatsSystem;

            thisStat = statsSys.GetStat(thisStatKey);
            thisStat.statWasModified += OnStatUpdate;

            OnStatUpdate();
        }
예제 #5
0
        public StatusState(StatsSystem sS, ExperienceSystem eS, StateMachine sM, NameSystem nS, PlayerSystem pS, ProfessionSystem profS)
        {
            statsSystem = sS;
            experienceSystem = eS;
            nameSystem = nS;
            playerSystem = pS;
            professionSystem = profS;

            stateSystem = sM;
        }
        private void Init(StatsSystem statsSys)
        {
            sb = new StringBuilder();

            this.statsSys = statsSys;

            maxHealthStat = this.statsSys.GetStat(StatTypeFactory.GetType("Max Health"));

            currentHealth = MaxHealth;
        }
예제 #7
0
        public InventoryState(EntityMaintenanceSystem emSys, StatsSystem sS, GearSystem gS, StatModifierSystem mS, ItemInventorySystem iS, StateMachine sM, NameSystem nSys)
        {
            entMaintenanceSystem = emSys;
            gearSystem = gS;
            statsSystem = sS;
            modifierSystem = mS;
            inventorySystem = iS;
            nameSystem = nSys;

            stateSystem = sM;
        }
예제 #8
0
    // Use this for initialization
    void Start()
    {
        m_stateSystem = this;

        //The intial state of the ship
        sliderArray[0].value = CaculateHealth();
        sliderArray[1].value = CaculateSpeed();
        sliderArray[2].value = CaculateEngine();
        sliderArray[3].value = CaculateFuel();
        sliderArray[4].value = CaculateDamage();
    }
예제 #9
0
        protected override void loadStatsSystems()
        {
            //(string _name, int _specialization, params Stat[] _stats)
            StatsSystem ss;

            #region Frontiersmen
            ss = new StatsSystem("Frontiersman", 1,
                                 createStat(AvailableStatistics.ATTACKS, 1),
                                 createStat(AvailableStatistics.DETERMINATION, 0),
                                 createStat(AvailableStatistics.DEXTERITY, 2),
                                 createStat(AvailableStatistics.INTELLIGENCE, 1),
                                 createStat(AvailableStatistics.STRENGTH, 1)
                                 );
            ss.setSkills(
                createSkill(AvailableSkills.AIM),
                createSkill(AvailableSkills.BRAVERY)
                );

            items.Add(ss);

            ss = new StatsSystem("Frontiersman Sergeant", 2,
                                 createStat(AvailableStatistics.ATTACKS, 2),
                                 createStat(AvailableStatistics.DETERMINATION, 1),
                                 createStat(AvailableStatistics.DEXTERITY, 2),
                                 createStat(AvailableStatistics.INTELLIGENCE, 1),
                                 createStat(AvailableStatistics.STRENGTH, 1)
                                 );
            ss.setSkills(
                createSkill(AvailableSkills.AIM),
                createSkill(AvailableSkills.BRAVERY),
                createSkill(AvailableSkills.MELEE),
                createSkill(AvailableSkills.LEADERSHIP)
                );

            items.Add(ss);

            ss = new StatsSystem("Frontiersman Mage", 2,
                                 createStat(AvailableStatistics.ATTACKS, 1),
                                 createStat(AvailableStatistics.DETERMINATION, 1),
                                 createStat(AvailableStatistics.DEXTERITY, 2),
                                 createStat(AvailableStatistics.INTELLIGENCE, 2),
                                 createStat(AvailableStatistics.STRENGTH, 0)
                                 );
            ss.setSkills(
                createSkill(AvailableSkills.AIM),
                createSkill(AvailableSkills.BRAVERY),
                createSkill(AvailableSkills.MAGIC)
                );

            items.Add(ss);
            #endregion Frontiersmen
        }
예제 #10
0
 // Start is called before the first frame update
 void Start()
 {
     currentState   = State.Idle;
     statsSystem    = GetComponent <StatsSystem>();
     abilitesSystem = GetComponent <AbilitesSystem>();
     healthSystem   = new HealthSystem(statsSystem.Health);
     rangeCombat    = new RangeCombat(gameObject.GetComponent <GameCharacter>());
     rangeCombat.ChangeWeapon(new BasicPistol(this));
     SubscribeToEvents();
     actionPointThisRound   = statsSystem.ActionPoints;
     movmentPointsThisRound = statsSystem.MovmentPointsPerRound;
     SetUpHealtText();
     OnReady?.Invoke(this, EventArgs.Empty);
 }
 public EntityMaintenanceSystem(EffectSystem eSys, EntityManager eMan, EquipmentSystem eqSys, ExperienceSystem xSys, GearSystem gSys, ItemInventorySystem invSys, ItemSystem iSys, NameSystem nSys, PlayerSystem pSys, ProfessionSystem profSys, StatsSystem sSys, StatModifierSystem smSys)
 {
     effectSystem = eSys;
     entityManager = eMan;
     equipmentSystem = eqSys;
     experienceSystem = xSys;
     gearSystem = gSys;
     inventorySystem=invSys;
     itemSystem = iSys;
     nameSystem = nSys;
     playerSystem = pSys;
     professionSystem = profSys;
     statsSystem = sSys;
     modifierSystem = smSys;
 }
예제 #12
0
        public int GetDexterity()
        {
            int output = 0;

            foreach (var x in sockets)
            {
                foreach (UnitSystem y in x.Value.systems)
                {
                    if (y.type == "Stats")
                    {
                        StatsSystem ss = (StatsSystem)y;
                        output += ss.GetStat("Dexterity");
                    }
                }
            }
            return(output);
        }
예제 #13
0
        public ShopState(EntityMaintenanceSystem eMS, GearSystem gSys, StatModifierSystem sMSys, StatsSystem sSys, ExperienceSystem eSys, PlayerSystem pSys, DropSystem dSys, NameSystem nSys, StateMachine sMach, ItemSystem iSys, GameMap gMap)
        {
            entMaintenanceSystem = eMS;
            gearSystem = gSys;
            modifierSystem = sMSys;
            statsSystem = sSys;
            experienceSystem = eSys;
            playerSystem = pSys;
            dropSystem=dSys;
            nameSystem = nSys;
            itemSystem = iSys;

            stateSystem = sMach;

            gameMap = gMap;
            NumItems = 5;
        }
예제 #14
0
        public CombatSystem(Lua Lua, ActionSystem actSys, ActionInventorySystem actInvSys, AISystem aiSys, DropSystem dSys, EffectSystem eSys, EntityMaintenanceSystem eMainSys, ExperienceSystem xSys, ItemInventorySystem iSys, NameSystem nSys, PlayerSystem pSys, StatsSystem sSys)
        {
            actionSystem = actSys;
            aInventorySystem = actInvSys;
            aiSystem = aiSys;
            dropSystem = dSys;
            effectSystem = eSys;
            entityMaintenanceSystem = eMainSys;
            experienceSystem = xSys;
            inventorySystem = iSys;
            nameSystem = nSys;
            playerSystem = pSys;
            statsSystem = sSys;

            lua = Lua;
            RegisterLuaFunctions();
        }
예제 #15
0
 public EntityManager(StateMachine sMach, DropSystem dSys, PlayerSystem pS, StatsSystem sS, ItemSystem iS, StatModifierSystem mS, EffectSystem efS, EquipmentSystem eqS, AISystem aiS, GearSystem gS, ExperienceSystem xS, ItemInventorySystem invS, NameSystem nS, ProfessionSystem profS, ActionSystem actS, ActionInventorySystem aInvS, CombatSystem cSys, EntityMaintenanceSystem eMS)
 {
     stateSystem = sMach;
     dropSystem = dSys;
     entMaintenanceSystem = eMS;
     aInventorySystem = aInvS;
     combatSystem = cSys;
     playerSystem = pS;
     statsSystem = sS;
     itemSystem = iS;
     modifierSystem = mS;
     effectSystem = efS;
     equipmentSystem = eqS;
     aiSystem = aiS;
     gearSystem = gS;
     experienceSystem = xS;
     inventorySystem = invS;
     nameSystem = nS;
     professionSystem = profS;
     actionSystem = actS;
 }
예제 #16
0
    protected virtual void Awake()
    {
        base.Awake();
        levelSystem        = new LevelSystem();
        statsSystem        = new StatsSystem(playerStatsDatum, levelSystem.GetLevel());
        healthPointsSystem = new HealthPointsSystem(statsSystem.GetTotalMaxHealthPoints());

        command = new NullCommand(this);

        #region State
        state    = basicState = new BasicState(this);
        dieState = new DieState(this, 5f);
        state.Begin();
        #endregion

        RuntimeAnimatorController runtimeAnimatorController = transform.Find("model").GetComponent <Animator>().runtimeAnimatorController;
        AnimationClip[]           animationClips            = runtimeAnimatorController.animationClips;

        for (int i = 0; i < animationClips.Length; i++)
        {
            clipLengths.Add(animationClips[i].name, animationClips[i].length);
            print(animationClips[i].name + ": " + animationClips[i].length);
        }
    }
예제 #17
0
 void Start()
 {
     getComponents();
     playerStats = new StatsSystem(health, damage);
     uiController.setUpHealthBar(health);
 }
예제 #18
0
 private void Awake()
 {
     statsSystem = statsSystemBehaviour.StatsSystem;
 }
예제 #19
0
 public BasicState(Player player) : base(player)
 {
     rigidbody   = player.GetComponent <Rigidbody>();
     statsSystem = player.GetStatsSystem();
 }
예제 #20
0
        private void InitializeSystems()
        {
            Console.WriteLine("Initializing Game Systems");

            professionSystem = new ProfessionSystem();
            effectSystem=new EffectSystem(lua);
            equipmentSystem = new EquipmentSystem();
            experienceSystem = new ExperienceSystem();         
            itemSystem = new ItemSystem();
            inventorySystem = new ItemInventorySystem();
            modifierSystem = new StatModifierSystem();
            nameSystem = new NameSystem(lua);
            playerSystem = new PlayerSystem(nameSystem, stateSystem);
            gearSystem = new GearSystem();
            statsSystem = new StatsSystem();
            aInventorySystem = new ActionInventorySystem(lua, statsSystem);
            actionSystem = new ActionSystem(lua);
            aiSystem = new AISystem();
            dropSystem = new DropSystem(dropMap);
        }
예제 #21
0
 //Comes before start
 void Awake()
 {
     Instance = this;
 }
        public StatsBasedHealthContainer(StatsSystem statsSys, IDeathProcessor deathProcessor)
        {
            this.deathProcessor = deathProcessor;

            Init(statsSys);
        }
예제 #23
0
 // Start is called before the first frame update
 void Start()
 {
     enemyStats = new StatsSystem(health, damage);
 }
예제 #24
0
 protected void Awake()
 {
     statsSystem        = new StatsSystem(statsDatum);
     healthPointsSystem = new HealthPointsSystem(statsSystem.GetTotalMaxHealthPoints());
 }