Esempio n. 1
0
    public void RevertBossMode()
    {
        SpawnExplsionPS();

        DarkTonic.MasterAudio.MasterAudio.PlaySound("explosion");
        DarkTonic.MasterAudio.MasterAudio.PlaySound("explosion", 1, 1, 0.05f);
        DarkTonic.MasterAudio.MasterAudio.PlaySound("explosion", 1, 1, 0.15f);

        DOVirtual.DelayedCall(0.8f, () => {
            GameObject ps         = Instantiate(Resources.Load <GameObject> ("BigBoom"));
            ps.transform.position = transform.position + Vector3.down * 2;
            ps.SetActive(true);
            Destroy(ps.gameObject, 4);
        });

        DOVirtual.DelayedCall(1.3f, () => {
            isDead     = false;
            isBoss     = false;
            pointIndex = 0;
            MoveToNextPoint();
            healthBar = GetComponentInChildren <Healthbar> (true);
            healthBar.Init(2);
            SetHostType(HostFigureType.Trump);
        });
    }
Esempio n. 2
0
        protected override void Initialize()
        {
            inv.Init(level, cmd);
            input.Init(level);
            chat.init(level, input, cmd);
            menu.init(input, cmd);
            cmd.init(this, level, chat, inv, menu, effectmanager, editor);
            level.init(input);
            editor.Init(level, input, GraphicsDevice.Viewport);
            sound.Init(level);
            hb.Init(level);
            foreach (var module in Global.mapModules)
            {
                module.Init(level);
            }

            NetCode.init(level, cmd);

            NetCode.Config = new NetPeerConfiguration("TestGame");
            NetCode.Client = new NetClient(NetCode.Config);
            NetCode.Client.Start();

            camera = new Camera(GraphicsDevice.Viewport);

            Global.Init(camera, time, sound, chat, cmd, new Random());

            base.Initialize();
        }
Esempio n. 3
0
    public void Init(PlayerConfig player, CharacterConfig character)
    {
        // healthText.GetComponent<Text> ().color = player.color;
        bar.Init(player.color);

        maxHealth     = character.healthPoints;
        numHealthLeft = maxHealth;
        UpdateHealthText();
    }
Esempio n. 4
0
 void LeaveHost()
 {
     if (currentHost != null)
     {
         previousHost = currentHost;
         healthbar.Init(3.5f);
         currentHost.healthBar.healthLeft = 0;
         currentHost = null;
     }
 }
Esempio n. 5
0
 void Start()
 {
     body            = GetComponent <Rigidbody2D> ();
     body.drag       = 3f;
     animator        = GetComponentInChildren <Animator> ();
     spriteTransform = transform.Find("Sprite");
     healthbar       = GetComponentInChildren <Healthbar> ();
     SetIdleOutOfHost();
     healthbar.Init(4);
 }
Esempio n. 6
0
    public void SetToBossMode(Healthbar bossHealthBar)
    {
        healthBar.Disable();
        healthBar = bossHealthBar;
        bossHealthBar.Init(10, false);
        isBoss = true;
        CircleCollider2D collider = GetComponentInChildren <CircleCollider2D> ();

        collider.offset = new Vector2(0, 1.41f);
        collider.radius = 2.04f;
    }
Esempio n. 7
0
    public void Infect()
    {
        if (m_isInfected || isDead)
        {
            return;
        }

        healthBar.Init(3);
        GameObject splatPS = Instantiate(Resources.Load("SplatPS") as GameObject);

        splatPS.transform.position = transform.position + Vector3.up;
        Destroy(splatPS, 2);
        GameManager.Instance.OnHostFigureInfected(this);
        if (hostType == HostFigureType.Trump)
        {
            wasTrump = true;
        }

        TurnToZombie();
        m_isInfected = true;
        m_spriteRenderer.transform.DOPunchScale(Vector3.one * 0.4f, 0.4f);
    }
Esempio n. 8
0
 void Start()
 {
     _healthbar = gameObject.AddComponent <Healthbar>();
     _healthbar.Init(_health, _health);
 }
Esempio n. 9
0
    private void Init()
    {
        moveJoystic   = GameController.GetInstance().moveJoystick;
        rotateJoystic = GameController.GetInstance().rotateJoystic;
        rb            = GetComponent <Rigidbody2D>();

        Physics2D.gravity = Vector2.zero;

        if (playerType == 2)
        {
            body.eulerAngles   = new Vector3(0, 180, 0);
            shell.eulerAngles  = new Vector3(0, 180, 0);
            turret.eulerAngles = new Vector3(0, 180, 0);
            if (turretAdjtPos != Vector3.zero)
            {
                turret.localPosition = turretAdjtPos;
            }
            if (shellAdjPos != Vector3.zero)
            {
                shell.localPosition = shellAdjPos;
            }
            //transform.eulerAngles = new Vector3(0,180,0);
            //canvas.eulerAngles = new Vector3(0, 180, 0);

            healthbar = GameController.GetInstance().health2;
            healthbar.Init();

            canvas.gameObject.SetActive(false);

            if (isAI)
            {
                projectileHolder.gameObject.SetActive(false);


                usedWeaponIds = new List <int>();
                usedWeaponIds.Add(1);
                usedWeaponIds.Add(2);
                usedWeaponIds.Add(3);
                usedWeaponIds.Add(4);
                usedWeaponIds.Add(5);
                usedWeaponIds.Add(6);

                usedWeaponIds = Randomize <int>(usedWeaponIds);
            }
        }
        else
        {
            healthbar = GameController.GetInstance().health1;
            healthbar.Init();
        }
        usedWeaponIds = new List <int>();

        activeWeapons = new List <RowWeapon>();
        foreach (RowWeapon weapon in GameController.Instance.allWeapons)
        {
            activeWeapons.Add(weapon);
        }



        Physics2D.gravity = GRAVITY;
        GenerateDot();
    }