public void Init(CharacterManager characterManager,
                  StatManager statManager,
                  EnemyActionManager enemyActionManager)
 {
     this.characterManager   = characterManager;
     this.statManager        = statManager;
     this.enemyActionManager = enemyActionManager;
 }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     //The initial spawn has a shorter Delay to start the action quickly
     spawnTimer = 5f;
     counter    = FindObjectOfType <StatManager>();
     //Makes the enemies spawn facing the center of the level
     transform.LookAt(Vector3.zero);
 }
    // Start is called before the first frame update
    void Start()
    {
        rbody = GetComponent <Rigidbody2D>();

        gameManager   = Toolbox.GetInstance().GetGameManager();
        statManager   = Toolbox.GetInstance().GetStatManager();
        energyManager = Toolbox.GetInstance().GetEnergyManager();
    }
Exemplo n.º 4
0
 public Pool(StatManager s, float costPerDamagePerSecondRatio, float damagePerSecondRatio, Slot slot, Element element)
     : base(s)
 {
     this.costPerDamagePerSecond = costPerDamagePerSecondRatio;
     this.damagePerSecondRatio = damagePerSecondRatio;
     this.slot = slot;
     this.element = element;
 }
Exemplo n.º 5
0
 private void Start()
 {
     pv       = GetComponent <PhotonView>();
     laderCor = LaderCor();
     statMgr  = transform.GetChild(0).GetComponent <StatManager>();
     light    = transform.GetChild(1).GetComponent <PlayerLight>();
     offStat  = transform.GetChild(0).GetComponent <offlineStat>();
 }
Exemplo n.º 6
0
 public Buffable(StatManager target, bool isPersistant, float finishTime, int procs)
 {
     IsPersistant   = isPersistant;
     _finishTime    = finishTime;
     _amountOfProcs = procs;
     Target         = target;
     Init();
 }
Exemplo n.º 7
0
 public void exit_game()
 {
     Debug.Log("exit");
     resume_game();
     clear_level(false);
     StatManager.save_stat();
     SceneManager.LoadScene("MapPick");
 }
Exemplo n.º 8
0
 private void Start()
 {
     shopUI.enabled = false;
     flowerSpawner  = FindObjectOfType <FlowerSpawner>();
     pollenManager  = FindObjectOfType <PollenManager>();
     hive           = FindObjectOfType <Hive>();
     statManager    = FindObjectOfType <StatManager>();
     ResetPricesToDefault();
 }
Exemplo n.º 9
0
    // if the player had not picked up a powerup this zone, set the counter to -1. Also, if check if player earned triple power-up achievement
    void CheckPowerupStatus()
    {
        zoneCountPowerups = -1;

        if (isShielded && isRecentlyHealed && isPenetrating)
        {
            StatManager.UnlockAchievement(6);
        }
    }
Exemplo n.º 10
0
 private void Awake()
 {
     if (Instance != null)
     {
         Debug.LogError("There can be only one statManager object loaded in the scene");
     }
     Instance           = this;
     BuiltObjectClasses = new Dictionary <object, Dictionary <string, StatBase> >();
 }
Exemplo n.º 11
0
    // method to transition the game into to the next zone
    IEnumerator AdvanceZone()
    {
        while (true)
        {
            // tell the player script that the zone advanced in order to check for the zone specific achievements & check for zone X in one run achievement
            playerControlArr[0].CrossedIntoZone();

            if (isFreshRun && zoneInt > 19)
            {
                StatManager.UnlockAchievement(13);
            }

            // allow blocks to spawn and get the times needed to spawn the tree area and advance the zone at the correct times
            canSpawn = true;
            GetZoneTimes();

            // wait until the time to switch from blocks to trees is reached
            while (gameTime < treeTime)
            {
                yield return(null);
            }

            canSpawn = false;

            while (gameTime < treeTime + 0.3f)
            {
                yield return(null);
            }

            // set the appropirate tree material color and start a tree area
            treeMat.color = new Color(zoneColor.r, zoneColor.g, zoneColor.b, 1);
            treeManager.StartTreeArea();

            // wait until the advance level time is reached + some time for the tree zone to end
            while (gameTime < advanceTime + 2.5f)
            {
                yield return(null);
            }

            // advance the zone int and increase the level speed and difficulty
            AdvanceZoneInt(false, 1);
            levelSpeed  = startingLevelSpeed + levelAccelerationRate * zoneInt;
            randControl = startingRandControl + spawnRate * zoneInt;

            // place the advancing trans above the mobile trans position
            advancingTrans.position = new Vector3(0, mobileTrans.position.y + 250, 0);

            // wait one more second
            while (gameTime < advanceTime + 4)
            {
                yield return(null);
            }

            // update block color
            boxMat.color = new Color(zoneColor.r, zoneColor.g, zoneColor.b, 1);
        }
    }
Exemplo n.º 12
0
    public void ButtonPress()
    {
#if UNITY_EDITOR
        UnityEditor.EditorApplication.isPlaying = false;
#else
        Application.Quit();
#endif
        StatManager.Save();
    }
Exemplo n.º 13
0
        public void TestGetCurrentAttributeKO()
        {
            Unit A = new Unit("test_A", null, null, new BasicSword());
            Dictionary <AttributeEnum, int> baseAttributes = StatHelper.GetDefaultAttributes();
            Dictionary <StatisticsEnum, Func <Unit, int> > statisticsComputer = StatHelper.GetDefaultComputer();
            StatManager statManager = new StatManager(A, null, null);

            Assert.AreEqual(0, statManager.GetCurrentAttribute(AttributeEnum.Agility));
        }
 void Start()
 {
     stats        = GetComponent <StatManager>();
     m_atkTrigger = transform.FindChild("AttackTrigger");
     m_atkTrigger.gameObject.SetActive(false);
     m_rb           = GetComponent <Rigidbody2D>();
     m_anim         = GetComponent <Animator>();
     m_ground_check = transform.Find("GroundCheck");
 }
Exemplo n.º 15
0
        public void doDamage(ulong GUID)
        {
            int dmg = 0;

            StatManager.CalculateSpellDamage(client.Player, null, spell, out dmg);

            ServerPacket pkg9 = new ServerPacket(SMSG.SPELLNONMELEEDAMAGELOG);

            // Target GUID
            pkg9.Write((ulong)GUID);
            // Caster GUID
            pkg9.Write((ulong)client.Player.GUID);
            // spellID
            pkg9.Write((short)spellId);
            // Fill the hole
            pkg9.Write((UInt16)0);
            // damage done
            pkg9.Write((short)dmg);
            // Fill the hole
            pkg9.Write((UInt16)0);
            // flag?
            pkg9.Write((byte)0x01);
            // damage absorbed
            pkg9.Write((UInt32)0);
            pkg9.Write((byte)0);
            pkg9.Write((byte)0);
            // damage blocked
            pkg9.Write((UInt32)0);
            pkg9.Write((byte)0);
            pkg9.Finish();

            client.Player.MapTile.Map.Send(pkg9, client.Player.Position, 25.0f);
            client.Player.UpdateData();

//			LivingObject targetObject = (LivingObject)ObjectManager.GetWorldObjectByGUID(GUID);
//			if (targetObject.ObjectType==OBJECTTYPE.UNIT)

            UnitBase uobj = (UnitBase)ObjectManager.GetWorldObject(OBJECTTYPE.UNIT, GUID);

            if (uobj != null)
            {
                client.Player.LastPosition = client.Player.Position;;
//				UnitBase uobj = (UnitBase)targetObject;
                if (!uobj.Attacking)
                {
                    uobj.StartCombat(client.Player.GUID);
                }

                uobj.DealDamage(client.Player, dmg);

                if (uobj.Dead && this.player.Selection != null && this.player.Selection.GUID == GUID)
                {
                    this.player.StopCombat();
                }
            }
        }
Exemplo n.º 16
0
    private void Awake()
    {
        GameObject.Find("BtnStart").GetComponent <Button>().onClick.AddListener(this.on_click_start);
        GameObject.Find("BtnQuit").GetComponent <Button>().onClick.AddListener(this.on_click_quit);

        var panel_gamemode = GameObject.Find("PanelGameMode");



        GameObject.Find("BtnClosePanel").GetComponent <Button>().onClick.AddListener(delegate { panel_gamemode.SetActive(false); });

        StatManager.load_stat();

        //var sp = GameObject.Find("BtnSinglePlayer").GetComponent<Toggle>();
        var mp   = GameObject.Find("BtnMultiPlayer").GetComponent <Toggle>();
        var easy = GameObject.Find("BtnEasy").GetComponent <Toggle>();
        var hard = GameObject.Find("BtnHard").GetComponent <Toggle>();

        Debug.Log(StatManager.get_state().game_mode);
        Debug.Log(StatManager.get_state().bot_level);

        //sp.onValueChanged.AddListener(b=>{if(b) StatManager.get_state().game_mode = 0;});
        mp.onValueChanged.AddListener(b => { if (b)
                                             {
                                                 StatManager.get_state().game_mode = 1;
                                             }
                                      });
        easy.onValueChanged.AddListener(b => { if (b)
                                               {
                                                   StatManager.get_state().bot_level = 0; StatManager.get_state().game_mode = 0;
                                               }
                                        });
        hard.onValueChanged.AddListener(b => { if (b)
                                               {
                                                   StatManager.get_state().bot_level = 2; StatManager.get_state().game_mode = 0;
                                               }
                                        });

        GameObject.Find("BtnGameMode").GetComponent <Button>().onClick.AddListener(() => {
            panel_gamemode.SetActive(true);
            if (StatManager.get_state().game_mode == 1)
            {
                mp.isOn = true;
            }
            if (StatManager.get_state().game_mode == 0 && StatManager.get_state().bot_level == 2)
            {
                hard.isOn = true;
            }
            else
            {
                easy.isOn = true;
            }
        });

        panel_gamemode.SetActive(false);
    }
Exemplo n.º 17
0
 public override void FireEvent()
 {
     if (!m_player.Dead && !m_player.RezSickness && (m_player.Health < m_player.MaxHealth || m_player.Power < m_player.MaxPower))
     {
         StatManager.CalculateRegenTick(m_player);
         m_player.UpdateData();
     }
     eventTime = DateTime.Now.Add(TimeSpan.FromSeconds(3));
     EventManager.AddEvent(this);
 }
Exemplo n.º 18
0
    public void Pause(float gameSpeed)
    {
        Time.timeScale = gameSpeed;
        pauseButton.SetActive(!pauseButton.activeSelf);
        pauseMenuPanel.SetActive(!pauseMenuPanel.activeSelf);
        int coins = StatManager.ConvertToCoins(Player.stoneResource + Player.woodResource + Player.foodResource, wavSpawner.wavesSurvived, false);

        coins            += StatManager.bonusCoins;
        coinsYouEarn.text = "You earn: " + (coins + StatManager.bonusCoins).ToString() + " coins!";
    }
Exemplo n.º 19
0
 public Projectile(StatManager s, Slot slot, Element element, float dmgRatio, float costRatio)
     : base(s)
 {
     this.costRatio = costRatio;
     this.slot = slot;
     this.element = element;
     this.dmgRatio = dmgRatio;
     spawning = new Queue<GameObject>();
     targets = new Queue<Vector3>();
 }
Exemplo n.º 20
0
    private void Start()
    {
        controller       = this.GetComponent <Controller2D>();
        enemyController  = this.GetComponent <EnemyController2D>();
        gunnerController = this.GetComponent <GunnerController>();

        stats        = this.GetComponent <StatManager>();
        charRenderer = this.GetComponent <SpriteRenderer>();
        animator     = this.GetComponent <Animator>();
    }
        public override void SetUp()
        {
            base.SetUp();
            stats = MakeDummyStatManager();
            pdm   = MakeTestComponent <PlantDomesticationManager>();

            Assert.IsNotNull(pdm.Stats);
            stats.Awake();
            pdm.Start();
        }
Exemplo n.º 22
0
    //투사체가 타겟에게 데미지를 주는 처리를 하는 메소드. 인터페이스
    public void DealingDamage(GameObject target)
    {
        StatManager enemy = target.gameObject.GetComponent <StatManager>();

        //타겟에게 데미지를 가함
        enemy.TakeDamage(damage);

        // 투사체 소멸
        Destroy(this.gameObject);
    }
Exemplo n.º 23
0
 public override void _Ready()
 {
     // Called every time the node is added to the scene.
     // Initialization here
     navPt            = (NavPoint)GetNode("../navpoint_container");
     sprite           = (Sprite)GetNode("Sprite");
     statManager      = (StatManager)GetNode("/root/StatManager");
     passOutAnimation = (AnimationPlayer)GetNode("../../CanvasLayer/PassOut");
     passOutTimer     = (Timer)GetNode("PassOutTimer");
 }
Exemplo n.º 24
0
 public Beam(StatManager s, float damagePerSecondRatio, Slot slot, Element element, float costPerDamagePerSecond)
     : base(s)
 {
     this.damagePerSecondRatio = damagePerSecondRatio;
     this.element = element;
     this.slot = slot;
     this.costPerDamagePerSecond = costPerDamagePerSecond;
     if (BeamLength == 0) {
         BeamLength = BEAM_LENGTH_DEFAULT;
     }
 }
 // Start is called before the first frame update
 void Awake()
 {
     AM        = FindObjectOfType <AudioManager>();
     spawntime = Time.time;
     AM.Play("EnemyBullet");
     if (GameObject.FindGameObjectWithTag("Player") != null)
     {
         player   = GameObject.FindGameObjectWithTag("Player");
         PlayerSM = player.GetComponent <StatManager>();
     }
 }
Exemplo n.º 26
0
    private void Start()
    {
        playerAnim  = this.GetComponent <Animator>();
        playerRB    = this.GetComponent <Rigidbody>();
        playerCol   = this.GetComponent <CapsuleCollider>();
        playerStats = this.GetComponent <StatManager>();
        audioSource = this.GetComponent <AudioSource>();

        attackCollider         = this.transform.GetChild(0).GetComponent <SphereCollider>();
        attackCollider.enabled = false;
    }
Exemplo n.º 27
0
    private void bind()
    {
        UmcPager1.PageSize = int.Parse(ddlPageSize.SelectedValue);

        DataSet ds = StatManager.GetInstance().GetConnectionLogList(CurrentPage, PageSize, SearchKeyword, SearchString);

        UmcPager1.RecordCount = int.Parse(ds.Tables[0].Rows[0][0].ToString());

        dlList.DataSource = ds.Tables[1];
        dlList.DataBind();
    }
Exemplo n.º 28
0
    // Use this for initialization
    void Start()
    {
        int numberOfBar           = System.Enum.GetNames(typeof(IndexEnumList.PointBarNames)).Length;
        int numberOfRectParameter = System.Enum.GetNames(typeof(IndexEnumList.RectParameter)).Length;

        posValues = new float[numberOfBar][];
        for (int i = 0; i < posValues.Length; i++)
        {
            posValues [i] = new float[numberOfRectParameter];
        }

        int barArrayLength = System.Enum.GetNames(typeof(IndexEnumList.BarValues)).Length;

        health = new int[barArrayLength];
        mana   = new int[barArrayLength];
        exp    = new int[barArrayLength];

        StatManager stat = GetComponent <StatManager>();

        CurrentHealth = stat.CurrentStats[(int)IndexEnumList.StatNames.currentHealth];
        CurrentMana   = stat.CurrentStats[(int)IndexEnumList.StatNames.currentSkillResource];
        MaxHealth     = stat.CurrentStats[(int)IndexEnumList.StatNames.maxHealth];
        MaxMana       = stat.CurrentStats[(int)IndexEnumList.StatNames.maxSkillResource];


        health [MAX]     = 1000;
        health [CURRENT] = 1000;

        mana [MAX]     = 100;
        mana [CURRENT] = 100;

        exp[MAX]     = 100;
        exp[CURRENT] = 1;

        posValues [FACEPIC][LEFT]   = 5;
        posValues [FACEPIC][TOP]    = 10;
        posValues [FACEPIC][WIDTH]  = 50;
        posValues [FACEPIC][HEIGHT] = 50;

        posValues [HEALTHBAR][LEFT]   = 60;
        posValues [HEALTHBAR][TOP]    = 10;
        posValues [HEALTHBAR][WIDTH]  = Screen.width / 4;
        posValues [HEALTHBAR][HEIGHT] = 20;

        posValues [MANABAR][LEFT]   = 60;
        posValues [MANABAR][TOP]    = 40;
        posValues [MANABAR][WIDTH]  = Screen.width / 4;
        posValues [MANABAR][HEIGHT] = 20;

        posValues [EXPBAR][LEFT]   = 60;
        posValues [EXPBAR][TOP]    = 65;
        posValues [EXPBAR][WIDTH]  = Screen.width / 4;
        posValues [EXPBAR][HEIGHT] = 10;
    }
Exemplo n.º 29
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 30
0
    public void ApplyStats(int Adding = 1)
    {
        StatManager sm = GameObject.FindObjectOfType <StatManager>();

        foreach (ItemMod im in itemMods)
        {
            sm.ChangeValue(im.Stat, im.Value * Adding);
        }

        isActive = true;
    }
 // Start is called before the first frame update
 private void Start()
 {
     VerticalSpeed = Random.Range(MinVerticalSpeed, MaxVerticalSpeed);
     if (GameObject.FindGameObjectWithTag("Player") != null)
     {
         player = GameObject.FindGameObjectWithTag("Player");
     }
     SM          = this.gameObject.GetComponent <StatManager>();
     PlayerSM    = player.GetComponent <StatManager>();
     SpawnHeight = SM.forward_projectile_spawn_height;
 }
Exemplo n.º 32
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Exemplo n.º 33
0
 public override void _Ready()
 {
     // Initialization here
     GD.Print("VC Init");
     replyTimer      = (Timer)GetNode("ReplyTimer");
     scrollTimer     = (Timer)GetNode("MoveScrollTimer");
     scrollDownTimer = (Timer)GetNode("ScrollDownTimer");    // To bring down UI
     statManager     = (StatManager)GetNode("/root/StatManager");
     msgScene        = (PackedScene)ResourceLoader.Load("res://Scenes/Chat/Message.tscn");
     doThemSay();
 }
Exemplo n.º 34
0
 public static Item GenerateStartingItem(Slot slot, StatManager statManager)
 {
     return new Item(){
             StatBoost = MORPHID_STARTING_ITEM_STATS,
             OffStatBoost = MORPHID_STARTING_ITEM_STATS,
             HealthBoost = MORPHID_STARTING_ITEM_STATS,
             MorphiumBoost = MORPHID_STARTING_ITEM_STATS,
             OffStatType = StatType.Attack,
             GrantedAbility = slot == Slot.Arm ?
                 new Projectile(statManager, slot, Element.Physical, 1f/3f, 0f){castTime = 0.1f, cooldown = 1.5f} :
                 null,
             Icon = null,
             FilledSlot = slot
         };
 }
Exemplo n.º 35
0
 public Move(StatManager s, GameObject toMove)
     : base(s, toMove)
 {
 }
Exemplo n.º 36
0
 public Spawn(StatManager s)
     : base(s)
 {
     target = statManager.GetComponent<Target>();
 }
Exemplo n.º 37
0
 public void Awake()
 {
     manager = GetComponent<StatManager>();
 }
Exemplo n.º 38
0
 private void Awake()
 {
     // get references
     statManager = GetSafeComponent<Character>().myStats;
     myTransform = transform;
 }
Exemplo n.º 39
0
 public Ability(StatManager statManager)
     : this(statManager, statManager.gameObject)
 {
 }
Exemplo n.º 40
0
 public Pool(StatManager s)
     : this(s, DEFAULT_COST_PER_DAMAGE_PER_SECOND, DEFAULT_DPS_RATIO, DEFAULT_SLOT, DEFAULT_ELEMENT)
 {
 }
Exemplo n.º 41
0
 void Awake()
 {
     if (StatManager.instance != null && StatManager.instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
 }
Exemplo n.º 42
0
 public Move(StatManager s)
     : base(s)
 {
 }
Exemplo n.º 43
0
	void Awake ()
	{
		ms_instance = this;
	}
Exemplo n.º 44
0
 public DoA(StatManager s)
     : base(s)
 {
 }
Exemplo n.º 45
0
 public Ability(StatManager statManager, GameObject host)
 {
     this.statManager = statManager;
     this.gameObject = host;
 }
Exemplo n.º 46
0
 /// <summary>
 /// Get magic ready for new character that has a myStats.
 /// </summary>
 /// <param name="stats"></param>
 public void Initialize(StatManager stats)
 {
     myStats = stats;
     currentMagic = (int)stats.magicPool.value;
 }
Exemplo n.º 47
0
 /// <summary>
 /// Set current and max health through the StatManager.
 /// </summary>
 /// <param name="statManager"></param>
 public void Initialize(StatManager stats)
 {
     currentHealth = maxHealth;
     this.statManager = stats;
 }
Exemplo n.º 48
0
 public DoA(StatManager s, GameObject g)
     : base(s, g)
 {
 }
Exemplo n.º 49
0
 public Projectile(StatManager s)
     : this(s, DEFAULT_SLOT, DEFAULT_ELEMENT, DEFAULT_DAMAGE_RATIO, DEFAULT_COST_RATIO)
 {
 }
Exemplo n.º 50
0
 void Update()
 {
     statManager = GameObject.FindGameObjectWithTag("Player").GetComponent<StatManager>();
 }