Inheritance: MonoBehaviour
    IEnumerator isAttackGround(float time)
    {
        time += Time.deltaTime;
        if (!sulfuras.GetComponent <Sulfuars>().isCollide || time <= 1f)
        {
            yield return(new WaitForEndOfFrame());

            StartCoroutine(isAttackGround(time));
        }
        else
        {
            yield return(null);

            Vector3 pos = sulfuras.transform.localPosition;
            pos.y = 0;
            KOFItem.InstantiateByPool(fireStamp, pos, Quaternion.Euler(0, 90, 0), GameController.instance.transform, gameObject.layer);
            GameObject[] traps = GameController.Register.LeftHero.HeroRegister.SearchCompontent("FireTrap");
            GameObject[] nearbytrips;
            int          n_near;
            n_near = isTrapNearby(traps, out nearbytrips);
            if (n_near != 0)
            {
                FireWall instance = KOFItem.InstantiateByPool(fireWall, pos, Quaternion.Euler(0, 90, 0), GameController.instance.transform, gameObject.layer);
                instance.damage = new RagnarosDamage(n_near * 50, DamageType.Fire, gameObject.layer);
                foreach (GameObject go in nearbytrips)
                {
                    go.GetComponent <FireTrap>().BeTrumped();
                }
            }
            //gameObject.GetComponent<RagnarosFireWall>().StartSkill(n_near);
        }
    }
Example #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("GameOver"))
     {
         GameManager.Instance.LoseGame();
     }
     if (other.CompareTag("Fireball"))
     {
         SoundController.Instance.PlayCollision();
         Fireball fireball = other.GetComponent <Fireball>();
         Collide(fireball.MoveDelay);
         rb.velocity = Vector3.zero;
         rb.AddForce(Vector3.up * fireball.HitForce.y, ForceMode.Impulse);
         if (Random.value < 0.5)
         {
             rb.AddForce(Vector3.left * fireball.HitForce.x, ForceMode.Impulse);
         }
         else
         {
             rb.AddForce(Vector3.right * fireball.HitForce.x, ForceMode.Impulse);
         }
         if (Random.value < 0.5)
         {
             rb.AddForce(Vector3.forward * fireball.HitForce.z, ForceMode.Impulse);
         }
         else
         {
             rb.AddForce(Vector3.back * fireball.HitForce.z, ForceMode.Impulse);
         }
     }
     if (other.CompareTag("GameWon"))
     {
         GameManager.Instance.WinGame();
     }
     if (other.CompareTag("WallOfFire"))
     {
         SoundController.Instance.PlayCollision();
         FireWall fireWall = other.GetComponentInParent <FireWall>();
         Collide(fireWall.MoveDelay);
         rb.velocity = Vector3.zero;
         rb.AddForce(Vector3.up * fireWall.HitForce.y, ForceMode.Impulse);
         if (Random.value < 0.5)
         {
             rb.AddForce(Vector3.left * fireWall.HitForce.x, ForceMode.Impulse);
         }
         else
         {
             rb.AddForce(Vector3.right * fireWall.HitForce.x, ForceMode.Impulse);
         }
         if (Random.value < 0.5)
         {
             rb.AddForce(Vector3.forward * fireWall.HitForce.z, ForceMode.Impulse);
         }
         else
         {
             rb.AddForce(Vector3.back * fireWall.HitForce.z, ForceMode.Impulse);
         }
     }
 }
Example #3
0
    void SpawnFireWall()
    {
        GameObject go       = Object.Instantiate(Resources.Load("Prefabs/Fire Wall"), new Vector3(transform.position.x, transform.position.y, transform.position.z), Quaternion.identity) as GameObject;
        FireWall   firewall = go.GetComponent <FireWall> ();

        firewall.Initialize(speed, direction, travelDistance);
        firewall.transform.parent = transform;
    }
Example #4
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Hardrive"))
        {
            if (boom != null)
            {
                Instantiate(boom, transform.position, Quaternion.identity);
            }

            if (damage != null)
            {
                damage(attackPower);
            }

            Destroy(gameObject);
        }

        else if (other.CompareTag("FireWall") && !worm)
        {
            gm.EnemiesDestroyed += 1;
            gm.Currency         += 50;
            Destroy(gameObject);
            fireWallUnit          = other.GetComponent <FireWall>();
            fireWallUnit.Defense -= 100;
        }

        else if (other.CompareTag("Patch"))
        {
            gm.EnemiesDestroyed += 1;
            gm.Currency         += 50;
            Destroy(gameObject);
            patchUnit          = other.GetComponent <Patch>();
            patchUnit.Defense -= 1;
        }

        if (other.CompareTag("Scan"))
        {
            if (gm.upgradeLevel[2] == 2)
            {
                gm.Currency += 150;
            }

            else if (gm.upgradeLevel[2] == 1)
            {
                gm.Currency += 100;
            }

            else
            {
                gm.Currency += 50;
            }

            Destroy(gameObject);
        }
    }
    protected override void Start()
    {
        base.Start();
        minigame = Resources.Load(Paths.firewallMinigame) as GameObject;
        if (minigame == null)
        {
            throw new System.Exception(Errormessage.resourceNull);
        }

        wall  = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <FireWall> ();
        input = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <FetchTerminalInput> ();
    }
        public void If_Wall_Is_Between_Two_Server_Then_Two_Server_Cannot_Connection_To_Eachother()
        {
            Mock <IHumanPlayer>      humanmock = new Mock <IHumanPlayer>();
            IActiveNetworkController active    = new ServerObject(humanmock.Object, 100, 25, 25, 100);
            INetworkController       target    = new ServerObject(10, 125, 25, 100);
            IFireWall fireWall = new FireWall(75, 25);

            this.game.GameObjects.Add(active);
            this.game.GameObjects.Add(target);
            this.game.GameObjects.Add(fireWall);
            this.game.ConnectTwoServer(active, target);
            Assert.That(active.Utps.Count == 0);
        }
    public void OnClickFirewall(GameObject panelLeft, GameObject panelRight, FireWall firewall)
    {
        this.data = data;
        currentLeftPanel.SetActive(false);
        currentLeftPanel = panelLeft;
        currentLeftPanel.SetActive(true);

        currentRightPanel.SetActive(false);
        currentRightPanel = panelRight;
        currentRightPanel.SetActive(true);


        //set the right firewall for rules management
        ToggleControl currentToggleControl = currentRightPanel.GetComponentInChildren <ToggleControl> ();

        currentToggleControl.firewall = firewall;
    }
Example #8
0
    // Updates the volume of the fire sound based on distance from the firewall
    // also distorts sound when underwater
    private void updateFireSound()
    {
        // No updating if the firewall hasn't been created yet
        if (_firewall == null)
        {
            GameObject wall = GameObject.FindGameObjectWithTag("FireWall");
            if (wall == null)
            {
                return;
            }
            else
            {
                _firewall = wall.GetComponent <FireWall>();
            }
        }

        float distFromCenter = Vector2.Distance(new Vector2(cameraTransform.position.x, cameraTransform.position.z), new Vector2(_firewall.transform.position.x, _firewall.transform.position.z));
        float distFromWall   = Mathf.Abs(_firewall.transform.localScale.x / 2 - distFromCenter);

        _fire.volume = (distFromWall > 0 ? 0.05f + 0.95f * Mathf.Pow(1 - distFromWall / 250, 4) : 1) / 3 * effectVolume;
    }
Example #9
0
        public static async Task <bool> SetQosRuleList(Model.QosRuleList qosRules)
        {
            try
            {
                string json = "{ \"qos_enable\": \"1\", \"qos_type\": \"2\", \"qos_bw_rulelist\": \"{0}\", \"action_mode\": \"apply\" }";
                json = json.Replace("{0}", qosRules.ToString());
                var res = await ApplyApp(json);

                if (res != null)
                {
                    return(await FireWall.RestartFireWall());
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                return(false);
            }
        }
Example #10
0
        private void SorceressSkill_VisibleChanged(object sender, EventArgs e)
        {
            FireVolt.SetSkillPoints    = "0";
            Wram.SetSkillPoints        = "0";
            Inferno.SetSkillPoints     = "0";
            Blaze.SetSkillPoints       = "0";
            FireBall.SetSkillPoints    = "0";
            FireWall.SetSkillPoints    = "0";
            Inchent.SetSkillPoints     = "0";
            Meteo.SetSkillPoints       = "0";
            FireMastary.SetSkillPoints = "0";
            Hydra.SetSkillPoints       = "0";

            FireVolt.setTextBoxColor();
            Wram.setTextBoxColor();
            Inferno.setTextBoxColor();
            Blaze.setTextBoxColor();
            FireBall.setTextBoxColor();
            FireWall.setTextBoxColor();
            Inchent.setTextBoxColor();
            Meteo.setTextBoxColor();
            FireMastary.setTextBoxColor();
            Hydra.setTextBoxColor();
        }
Example #11
0
    public override void ControlCharacter()
    {
        //Debug.Log(state, Department.PLAYER, Color.PINK);
        curr_hp = health.GetCurrentHealth();

        // First check if you are alive
        if (curr_hp > 0)
        {
            //Check play breath audio
            base.CheckHealth(curr_hp, max_hp, "DaenerysBreathing");

            // Check if player is moving to block attacks/abilities
            if (!movement.IsMoving())
            {
                /* Player is alive */

                switch (state)
                {
                case State.IDLE:
                {
                    //Check For Input + It has to check if she's moving to block attack (¿?)
                    CheckAttack();
                    break;
                }

                case State.ATTACKING:
                {
                    AttackLeftTimer += Time.deltaTime;
                    //Check for end of the Attack animation
                    if (anim_controller.IsAnimationStopped("Idle"))
                    {
                        if (anim_controller.IsAnimOverXTime(0.6f) && play_audio_roar)
                        {
                            GameObject flamethr = Instantiate("CorrectDaenerysFireBreath");

                            flamethr.transform.SetPosition(GetFlameBreathPosition(curr_position));
                            flamethr.transform.SetRotation(flamethr.transform.GetRotation());

                            Fireball fballscript = flamethr.GetComponent <Fireball>();
                            fballscript.vfront = curr_forward;
                            fballscript.SetDamage(left_ability_dmg);
                            fballscript.SetDistance(left_ability_distance);

                            GameObject coll_object = PhysX.RayCast(curr_position, curr_forward, 254.0f);
                            if (coll_object != null)
                            {
                                coll_object.GetTag();
                                if (coll_object.CompareTag("Enemy"))
                                {
                                    fballscript.vfront = GetSecondaryForwardToEnemy(flamethr.transform.GetPosition(), coll_object.transform.GetPosition());
                                }
                            }
                            PlayFx("DaenerysDragonRoar");
                            play_audio_roar = false;
                        }

                        if (anim_controller.IsAnimationStopped("AttackLeft"))
                        {
                            state = State.IDLE;
                        }
                    }
                    else if (play_audio_roar == false)
                    {
                        state = State.IDLE;
                    }
                    if (AttackLeftTimer >= 1.35f)
                    {
                        state = State.IDLE;
                    }
                    break;
                }

                case State.FIRE_WALL:
                {
                    //Check for end of the Attack animation
                    if (anim_controller.IsAnimationStopped("Idle"))
                    {
                        if (set_fire_wall == false && anim_controller.IsAnimOverXTime(0.3f))
                        {
                            int tile_x, tile_y;
                            movement.GetPlayerPos(out tile_x, out tile_y);
                            Vector3 player_pos = player.GetComponent <Transform>().GetPosition();
                            player_pos.y -= 9.1f;
                            MovementController.Direction direction = movement.curr_dir;
                            switch (direction)
                            {
                            case MovementController.Direction.NORTH:
                            {
                                tile_y       -= 1;
                                player_pos.z -= 25.4f;
                                break;
                            }

                            case MovementController.Direction.SOUTH:
                            {
                                tile_y       += 1;
                                player_pos.z += 25.4f;
                                break;
                            }

                            case MovementController.Direction.EAST:
                            {
                                tile_x       += 1;
                                player_pos.x += 25.4f;
                                break;
                            }

                            case MovementController.Direction.WEST:
                            {
                                tile_x       -= 1;
                                player_pos.x -= 25.4f;
                                break;
                            }

                            default:
                            {
                                break;
                            }
                            }
                            //GET TILE POS!
                            GameObject fire_wall = Instantiate("FireWall");
                            fire_wall.transform.SetPosition(player_pos);
                            FireWall fire_wall_controller = fire_wall.GetComponent <FireWall>();
                            fire_wall_controller.SetTiles(tile_x, tile_y);
                            fire_wall_controller.SetDamage(right_ability_dmg);
                            set_fire_wall = true;
                        }

                        if (anim_controller.IsAnimOverXTime(0.8f))
                        {
                            state = State.IDLE;
                        }
                    }
                    else if (set_fire_wall == true && IsAnimationStopped("AttackRight"))
                    {
                        state = State.IDLE;
                    }
                    break;
                }

                case State.HIT:
                {
                    //Check for end of the Attack animation
                    if (anim_controller.IsAnimationStopped("Hit"))
                    {
                        state = State.IDLE;
                    }
                    break;
                }

                case State.DEAD:
                {
                    break;
                }

                default:
                {
                    break;
                }
                }
            }
        }
    }
Example #12
0
 public void Awake()
 {
     thisObject = gameObject.GetComponent <FireWall> ();
 }
Example #13
0
        /// <inheritdoc/>
        public void LoadMap(IMap map)
        {
            this.GameType  = GameType.Campaign;
            this.MapNumber = map.Id;
            IMapDatas datas = map.MapData;

            this.TickCount = 0;
            this.Score     = this.startscore;
            this.MapHeight = (int)datas.MapSize.Height;
            this.MapWidth  = (int)datas.MapSize.Width;

            this.LifeLimit = datas.PowerLimit;

            this.LocalPlayer = AllPlayers[PlayerType.LocalHumanPlayer] as IHumanPlayer;
            this.Players.Clear();

            foreach (var item in datas.Players)
            {
                this.Players.Add(AllPlayers[(PlayerType)Enum.Parse(typeof(PlayerType), item)]);
            }

            this.Messages.Clear();
            this.GameObjects.Clear();
            foreach (var item in datas.Servers)
            {
                string[] data = item.Split('#');
                if (data[0] == "Active")
                {
                    IGameObject server = new ServerObject(
                        AllPlayers[(PlayerType)Enum.Parse(typeof(PlayerType), data[1])],
                        int.Parse(data[2]),
                        int.Parse(data[3]),
                        int.Parse(data[4]),
                        this.LifeLimit);
                    this.GameObjects.Add(server);
                }
                else
                {
                    IGameObject server = new ServerObject(
                        int.Parse(data[1]),
                        int.Parse(data[2]),
                        int.Parse(data[3]),
                        this.LifeLimit);
                    this.GameObjects.Add(server);
                }
            }

            foreach (var item in datas.Routers)
            {
                string[] data = item.Split('#');
                if (data[0] == "Active")
                {
                    IGameObject router = new Router(
                        AllPlayers[(PlayerType)Enum.Parse(typeof(PlayerType), data[1])],
                        int.Parse(data[2]),
                        int.Parse(data[3]),
                        int.Parse(data[4]),
                        this.LifeLimit);
                    this.GameObjects.Add(router);
                }
                else
                {
                    IGameObject router = new Router(
                        int.Parse(data[1]),
                        int.Parse(data[2]),
                        int.Parse(data[3]),
                        this.LifeLimit);
                    this.GameObjects.Add(router);
                }
            }

            foreach (var item in datas.FireWalls)
            {
                string[]    data     = item.Split('#');
                IGameObject firewall = new FireWall(int.Parse(data[0]), int.Parse(data[1]));

                this.GameObjects.Add(firewall);
            }

            this.SortGameObjects();
        }
    void setFireWall()
    {
        FireWall fireWall = fireWallPrefab.GetComponent <FireWall>();

        fireWall.bulletNum = 20;
    }
Example #15
0
 void Awake()
 {
     rb       = GetComponent <Rigidbody> ();
     head     = FindObjectOfType <CardboardHead> ();
     fireWall = FindObjectOfType <FireWall> ();
 }
Example #16
0
 public void initInventory()
 {
     inventorySkills = new baseSkill[14];
     inventorySkills [0] = new Arrays ();
     inventorySkills [1] = new BreakAndContinue ();
     inventorySkills [2] = new DDOS ();
     inventorySkills [3] = new DefaultFunctions ();
     inventorySkills [4] = new FireWall ();
     inventorySkills [5] = new FunctionsWithInputOutput ();
     inventorySkills [6] = new FunctionsWithOutput ();
     inventorySkills [7] = new Hash ();
     inventorySkills [8] = new IfElse ();
     inventorySkills [9] = new InfiniteLoop ();
     inventorySkills [10] = new Loop ();
     inventorySkills [11] = new PacketSniffing ();
     inventorySkills [12] = new Recursion ();
     inventorySkills [13] = new Stack ();
     Debug.Log ("Finished Loading Inventory");
 }
Example #17
0
 public void Start()
 {
     player = GameObject.FindGameObjectWithTag(Tags.miniPlayer).transform;
     wall   = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <FireWall>();;
     speed  = 0.8f;
 }