예제 #1
0
    public override void Execute(Attack attack, ButtleManager buttlemanager)
    {
        //  buttlemanager._EnemyManager = GameObject.Find("EnemyManager");

        if (IsFirst)
        {
            //敵からプレイヤへ攻撃
            List <float> NewHpDate = buttlemanager._PlayerManager.GetComponent <PlayerManager>().HitDamage(buttlemanager._EnemyManager.GetComponent <EnemyManager>().GetAttack());
            foreach (var item in NewHpDate)
            {
                buttlemanager.ButtleAnimationCreate(buttlemanager._PlayerManager.GetComponent <PlayerManager>().HpPrefab.GetComponent <HpBar>(), item, new Vector3(0, 0, 0), new Vector3(0, 0, 0));
            }
            IsFirst = false;
        }
        buttlemanager.ButtleAnimationDestroy();

        if (buttlemanager._ButtleAnimationList.Count == 0)
        {
            if (IsEnemyCreate)
            {
                buttlemanager.ChangeState(EnemyCreate.GetInstance());
            }
            else
            {
                buttlemanager.ChangeState(Wait.GetInstance());
            }
            //プレイヤの攻撃に移行
            attack._AttackState = PlayerAttack.GetInstance();
        }
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     PlayerManager = GameObject.Find("PlayerManager");
     //Enemy = GameObject.Find("Enemy");
     // Enemy = Instantiate(Enemy);
     ButtleState = EnemyCreate.GetInstance();
     //ステージ生成
     Stage        = Instantiate(Stage);
     EnemyManager = Instantiate(EnemyManager);
     //  BottanManager = GameObject.Find("BottonManager");
 }
예제 #3
0
        public bool CreateEnemy(EnemyCreate model)
        {
            var entity = new Enemy
            {
                Name        = model.Name,
                Description = model.Description,
                Health      = model.Health,
                LocationID  = model.LocationID
            };

            ctx.Enemies.Add(entity);
            return(ctx.SaveChanges() == 1);
        }
예제 #4
0
        public IHttpActionResult Post(EnemyCreate note)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var service = CreateEnemyService();

            if (!service.CreateEnemy(note))
            {
                return(InternalServerError());
            }

            return(Ok());
        }
예제 #5
0
        public ActionResult Create(EnemyCreate model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var service = new EnemyService();

            if (service.CreateEnemy(model))
            {
                return(RedirectToAction("Index"));
            }

            ModelState.AddModelError("", "Enemy could not be created");

            return(View(model));
        }
예제 #6
0
    void Init()
    {
        for (int i = 0; i < POOL_SIZE; i++)
        {
            GameObject obj = Instantiate(EnemyCreate.Instance().disk);
            obj.SetActive(false);
            diskPool[i] = obj;

            diskPool[i].GetComponent <Disk>().poolIndex = i;
            if (i == 0)
            {
                continue;
            }
            diskPool[i - 1].GetComponent <Disk>().nextDisk = diskPool[i];
        }
        diskPool[POOL_SIZE - 1].GetComponent <Disk>().nextDisk = null;
        firstAvailable = diskPool[0];
    }
예제 #7
0
        public ActionResult Create(EnemyCreate model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var service = CreateEnemyService();

            if (service.CreateEnemy(model))
            {
                TempData["SaveResult"] = "New enemy created.";
                return(RedirectToAction("Index"));
            }
            ;

            ModelState.AddModelError("", "Enemy could not be created.");

            return(View(model));
        }
예제 #8
0
        public bool CreateEnemy(EnemyCreate model)
        {
            var entity =
                new Enemy()
            {
                OwnerId    = _userId,
                Name       = model.Name,
                KineticAC  = model.KineticAC,
                EnergyAC   = model.EnergyAC,
                Fortitude  = model.Fortitude,
                Reflex     = model.Reflex,
                Will       = model.Will,
                HP         = model.HP,
                Initiative = model.Initiative,
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Enemies.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
예제 #9
0
 void OnGUI()
 {
     GUI.Label(new Rect(10, 10, 100, 20), "Round:" + (EnemyCreate.Instance().GetRoundIndex() + 1));
 }
예제 #10
0
    //BigDamageの時は、その3つのsphereをレインボーにしたいな。


    void Start()
    {
        enemyAttackEffect = new GameObject[10];

        inputEnergyID            = new int[4];
        getEnergyID              = new int[4];
        correctOrder             = 0;
        battleGameEnergy         = new GameObject[10];
        battleGameEnergyMaterial = new MeshRenderer[10];

        for (int i = 0; i > 4; i++)
        {
            inputEnergyID[i] = 0;
            getEnergyID[i]   = 0;
        }

        battleGameCanvas                  = GameObject.Find("Canvas_battleGame");
        battleGameEnergyCanvas            = GameObject.Find("Canvas_battleGameEnergy");
        battleGameEnergyCanvas_mouseInput = battleGameEnergyCanvas.GetComponent <MouseInput>();

        battleGameEnergy[1] = GameObject.FindGameObjectWithTag("touchEnergy1");
        battleGameEnergy[2] = GameObject.FindGameObjectWithTag("touchEnergy2");
        battleGameEnergy[3] = GameObject.FindGameObjectWithTag("touchEnergy3");
        battleGameEnergy[4] = GameObject.FindGameObjectWithTag("touchEnergy4");
        battleGameEnergy[5] = GameObject.FindGameObjectWithTag("touchEnergy5");
        battleGameEnergy[6] = GameObject.FindGameObjectWithTag("touchEnergy6");
        battleGameEnergy[7] = GameObject.FindGameObjectWithTag("touchEnergy7");
        battleGameEnergy[8] = GameObject.FindGameObjectWithTag("touchEnergy8");
        battleGameEnergy[9] = GameObject.FindGameObjectWithTag("touchEnergy9");

        battleGameEnergyMaterial[1] = battleGameEnergy[1].GetComponent <MeshRenderer>();
        battleGameEnergyMaterial[2] = battleGameEnergy[2].GetComponent <MeshRenderer>();
        battleGameEnergyMaterial[3] = battleGameEnergy[3].GetComponent <MeshRenderer>();
        battleGameEnergyMaterial[4] = battleGameEnergy[4].GetComponent <MeshRenderer>();
        battleGameEnergyMaterial[5] = battleGameEnergy[5].GetComponent <MeshRenderer>();
        battleGameEnergyMaterial[6] = battleGameEnergy[6].GetComponent <MeshRenderer>();
        battleGameEnergyMaterial[7] = battleGameEnergy[7].GetComponent <MeshRenderer>();
        battleGameEnergyMaterial[8] = battleGameEnergy[8].GetComponent <MeshRenderer>();
        battleGameEnergyMaterial[9] = battleGameEnergy[9].GetComponent <MeshRenderer>();

        ProgressManager = GameObject.Find("ProgressManager");
        gameProgress    = ProgressManager.GetComponent <GameProgress>();

        BattleCamera = GameObject.Find("BattleCamera");
        battleCamera = BattleCamera.GetComponent <Camera>();

        EnemyNameCamera = GameObject.Find("EnemyNameCamera");
        enemyNameCamera = EnemyNameCamera.GetComponent <Camera>();

        playerEnergyAmount = GameObject.Find("Canvas_battleGameEnergyAmount/energyAmountText").GetComponent <TextMeshProUGUI>();

        enemyName = GameObject.Find("Canvas_enemyName/enemyName").GetComponent <TextMeshProUGUI>();

        enemyCreate = new EnemyCreate();
        //絶望のノーマル攻撃エフェクトを取得
        enemyAttackEffect[1] = GameObject.Find("EnemyNormalAttack"); //Objectとしてむりくり置いて、名前で強引に呼び出し
        enemyAttackEffect[1].SetActive(false);                       //このやり方だとエフェクトの種類ごとに取得しなきゃいけないし、さらに無駄が多そうだー

        phase = Phase.tellEncountEnemy;

        fade = GameObject.Find("FadeCanvas_enemyName2BtlScene").GetComponent <Fade>();

        enemyHpGauge     = GameObject.Find("EnemyHpFill");
        enemyTimeTillAtk = GameObject.Find("EnemyTimeFill");
        enemyTimeTillAtk.SetActive(false);

        time         = 0;
        ellapsedTime = 2;
    }