Exemplo n.º 1
0
        public PetBase(PetName X, int nivel = 1)
        {
            PetBase Y = PetFactory.GetPet(X);

            petFeat             = Y.petFeat;
            atkManager          = Y.GerenteDeGolpes;
            movFeat             = Y.MovFeat;
            alturaCamera        = Y.alturaCamera;
            distanciaCamera     = Y.distanciaCamera;
            alturaCameraLuta    = Y.alturaCameraLuta;
            distanciaCameraLuta = Y.distanciaCameraLuta;
            petId = X;

            if (nivel > 1)
            {
                PetFeat.IncrementaNivel(nivel);
            }


            atkManager.meusGolpes = new List <PetAttackBase>();
            atkManager.meusGolpes.AddRange(GolpesAtivos(nivel, atkManager.listaDeGolpes.ToArray()));


            VerificaSomaDeTaxas();

            if (StManager == null)
            {
                stManager = new StaminaManager();
            }
        }
Exemplo n.º 2
0
        public static bool CanStartAttack(PetBase meuCriatureBase)
        {
            PetAtributes     A   = meuCriatureBase.PetFeat.meusAtributos;
            PetAttackManager ggg = meuCriatureBase.GerenteDeGolpes;
            PetAttackBase    gg  = ggg.meusGolpes[ggg.golpeEscolhido];

            if (
                //gg.UltimoUso + gg.TempoDeReuso < Time.time
                meuCriatureBase.StManager.VerifyStaminaAction() &&
                A.PE.Corrente >= gg.CustoPE)
            {
                A.PE.Corrente -= gg.CustoPE;
                //gg.UltimoUso = Time.time;
                meuCriatureBase.StManager.ConsumeStamina((uint)gg.CustoDeStamina);

                //AplicadorDeGolpe aplG = gameObject.AddComponent<AplicadorDeGolpe>();

                //aplG.esseGolpe = gg;

                //GameController.g.HudM.AtualizaDadosDaHudVida(false);

                //if (GameController.g.estaEmLuta)
                //    GameController.g.HudM.AtualizaDadosDaHudVida(true);

                // if(!GameController.g.estaEmLuta)
                //   //GameController.g.HudM.AtualizaHudHeroi(meuCriatureBase);

                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 3
0
        public static void EnergiaEVidaCheia(PetBase C)
        {
            PetAtributes A = C.petFeat.meusAtributos;

            A.PV.Corrente = A.PV.Maximo;
            A.PE.Corrente = A.PE.Maximo;
        }
Exemplo n.º 4
0
        public static GameObject Initialize(Transform dono, PetBase pet)
        {
            GameObject G = InstantiatePet(dono, pet);

            ConfigureCriatureBase(G, pet, dono);
            return(G);
        }
Exemplo n.º 5
0
        public void StartReplace(Transform hero, Transform alvo, FluxoDeRetorno fluxo, PetBase petToGoOut)
        {
            this.fluxo      = fluxo;
            this.petToGoOut = petToGoOut;
            this.hero       = hero;
            #region suprimido
            //List<CriatureBase> lista = manager.Dados.CriaturesAtivos;
            //CriatureBase temp = lista[0];
            //lista[0] = lista[manager.Dados.CriatureSai + 1];
            //lista[manager.Dados.CriatureSai + 1] = temp;

            //manager.Estado = EstadoDePersonagem.parado;
            //manager.CriatureAtivo.PararCriatureNoLocal();
            //manager.Mov.Animador.PararAnimacao();

            //GameController.g.HudM.ModoLimpo();
            //GameController.g.HudM.Painel.EsconderMensagem();

            //estouTrocandoDeCriature = true;
            #endregion
            animaB = new AnimateArm(hero, alvo);
            MessageAgregator <MsgStartReplacePet> .Publish(new MsgStartReplacePet()
            {
                dono = hero.gameObject
            });
        }
Exemplo n.º 6
0
        public static PetAttackDb RetornaGolpePersonagem(GameObject G, AttackNameId nomeDoGolpe)
        {
            PetBase          criatureBase = G.GetComponent <PetManager>().MeuCriatureBase;
            PetAttackManager gg           = criatureBase.GerenteDeGolpes;
            PetAttackDb      gP           = gg.ProcuraGolpeNaLista(criatureBase.NomeID, nomeDoGolpe);

            return(gP);
        }
Exemplo n.º 7
0
        public static PetManager Initialize(PetName petName, int nivel, Vector3 pos)
        {
            PetBase    P = new PetBase(petName, nivel);
            GameObject G = InstantiatePet(P, pos);

            G.transform.position = MelhoraInstancia.ProcuraPosNoMapa(G.transform.position);
            return(ConfigureCriatureBase(G, P));
        }
Exemplo n.º 8
0
        public static colisor GetCollider(GameObject G, AttackNameId nomeColisor)
        {
            PetBase          criatureBase = G.GetComponent <PetManager>().MeuCriatureBase;
            PetAttackManager gg           = criatureBase.GerenteDeGolpes;
            PetAttackDb      gP           = gg.ProcuraGolpeNaLista(criatureBase.NomeID, nomeColisor);

            return(gP.Colisor);
            /*GolpePersonagem.RetornaGolpePersonagem(G, nomeColisor).Colisor;*/
        }
Exemplo n.º 9
0
        public static void ConfigureCriatureBase(GameObject G, PetBase cBase, Transform dono)
        {
            G.name = "CriatureAtivo";
            PetManager Cc = G.GetComponent <PetManager>();

            MonoBehaviour.Destroy(Cc);
            PetManagerCharacter C = G.AddComponent <PetManagerCharacter>();

            C.T_Dono          = dono;
            C.MeuCriatureBase = cBase;

            //RecolocadorDeStatus.VerificaInsereParticulaDeStatus(C);
        }
Exemplo n.º 10
0
        public static GameObject InstantiatePet(PetBase criature, Vector3 position)
        {
            GameObject CA = Resources.Load <GameObject>("Criatures/" + criature.NomeID.ToString());

            CA = MonoBehaviour.Instantiate(CA, position, Quaternion.identity)
                 as GameObject;


            SceneManager.MoveGameObjectToScene(CA,
                                               SceneManager.GetSceneByName(SpecialSceneName.ComunsDeFase.ToString())
                                               );
            return(CA);
        }
Exemplo n.º 11
0
        /*
         * public bool SouOMesmoQue(PetBase C)
         * {
         *  bool retorno = false;
         *
         *  if (C.NomeID == nome
         *      &&
         *      C.petFeat.mNivel.Nivel==petFeat.mNivel.Nivel
         *      &&
         *      C.petFeat.mNivel.XP == petFeat.mNivel.XP
         *      &&
         *      C.petFeat.meusAtributos.PV.Corrente == petFeat.meusAtributos.PV.Corrente
         *      &&
         *      C.petFeat.meusAtributos.PV.Maximo == petFeat.meusAtributos.PV.Maximo
         *      &&
         *      C.petFeat.meusAtributos.PE.Corrente == petFeat.meusAtributos.PE.Corrente
         *      &&
         *      C.petFeat.meusAtributos.PE.Maximo == petFeat.meusAtributos.PE.Maximo
         *      )
         *  retorno = true;
         *  return retorno;
         * }*/

        public object Clone()
        {
            PetBase retorno =
                new PetBase()
            {
                NomeID              = NomeID,
                alturaCamera        = alturaCamera,
                distanciaCamera     = distanciaCamera,
                alturaCameraLuta    = alturaCameraLuta,
                distanciaCameraLuta = distanciaCameraLuta,
                petFeat             = new PetFeatures()
                {
                    meusTipos = (PetTypeName[])petFeat.meusTipos.Clone(),
                    distanciaFundamentadora = petFeat.distanciaFundamentadora,
                    meusAtributos           =
                    {
                        PV     = { Taxa = petFeat.meusAtributos.PV.Taxa     },
                        PE     = { Taxa = petFeat.meusAtributos.PE.Taxa     },
                        Ataque = { Taxa = petFeat.meusAtributos.Ataque.Taxa },
                        Defesa = { Taxa = petFeat.meusAtributos.Defesa.Taxa },
                        Poder  = { Taxa = petFeat.meusAtributos.Poder.Taxa  }
                    },
                    contraTipos = petFeat.contraTipos
                },
                GerenteDeGolpes = new PetAttackManager()
                {
                    listaDeGolpes = atkManager.listaDeGolpes,
                },
                MovFeat = new MoveFeatures()
                {
                    walkSpeed = movFeat.walkSpeed,
                    runSpeed  = movFeat.runSpeed,
                    rotAlways = movFeat.rotAlways,
                    rollSpeed = movFeat.rollSpeed,
                    jumpFeat  = new JumpFeatures()
                    {
                        fallSpeed         = movFeat.jumpFeat.fallSpeed,
                        horizontalDamping = movFeat.jumpFeat.horizontalDamping,
                        initialImpulse    = movFeat.jumpFeat.initialImpulse,
                        inJumpSpeed       = movFeat.jumpFeat.inJumpSpeed,
                        jumpHeight        = movFeat.jumpFeat.jumpHeight,
                        maxTimeJump       = movFeat.jumpFeat.maxTimeJump,
                        minTimeJump       = movFeat.jumpFeat.minTimeJump,
                        risingSpeed       = movFeat.jumpFeat.risingSpeed,
                        verticalDamping   = movFeat.jumpFeat.verticalDamping
                    }
                }
            };

            return(retorno);
        }
Exemplo n.º 12
0
        public static PetManager ConfigureCriatureBase(GameObject G, PetBase cBase)
        {
            string s = System.Guid.NewGuid().ToString();

            G.name = "Enemy: " + s.Substring(0, 7);
            PetManager Cc = G.GetComponent <PetManager>();

            MonoBehaviour.Destroy(Cc);
            PetManagerEnemy C = G.AddComponent <PetManagerEnemy>();

            C.MeuCriatureBase = cBase;

            return(C);

            //RecolocadorDeStatus.VerificaInsereParticulaDeStatus(C);
        }
Exemplo n.º 13
0
        public static int ContemStatus(StatusType esseStatus, PetBase X)
        {
            int retorno = -1;

            if (X.StatusTemporarios.Count > 0)
            {
                foreach (DatesForTemporaryStatus sT in X.StatusTemporarios)
                {
                    if (sT.Tipo == esseStatus)
                    {
                        retorno = X.StatusTemporarios.IndexOf(sT);
                    }
                }
            }

            return(retorno);
        }
Exemplo n.º 14
0
        static void CalculaDano(PetManager doAtacado, GameObject atacante, PetAttackBase golpe)
        {
            float multiplicador = 1;

            for (int i = 0; i < doAtacado.MeuCriatureBase.PetFeat.contraTipos.Length; i++)
            {
                if (golpe.Tipo.ToString() == doAtacado.MeuCriatureBase.PetFeat.contraTipos[i].Nome)
                {
                    multiplicador *= doAtacado.MeuCriatureBase.PetFeat.contraTipos[i].Mod;
                }
            }

            PetBase      cDoAtacante = atacante.GetComponent <PetManager>().MeuCriatureBase;
            PetAtributes A           = cDoAtacante.PetFeat.meusAtributos;

            int potenciaDoAtacante = (golpe.Caracteristica == AttackDiferentialId.colisao)
                ?
                                     Mathf.RoundToInt(A.Ataque.Minimo + (A.Ataque.Corrente - A.Ataque.Minimo) * Random.Range(0.85f, 1))
                :
                                     Mathf.RoundToInt(A.Poder.Minimo + (A.Poder.Corrente - A.Poder.Minimo) * Random.Range(0.85f, 1));

            int numStatus = StatusTemporarioBase.ContemStatus(StatusType.fraco, cDoAtacante);

            if (numStatus > -1)
            {
                potenciaDoAtacante = (int)Mathf.Max(1 / cDoAtacante.StatusTemporarios[numStatus].Quantificador * potenciaDoAtacante, (A.Ataque.Minimo + A.Poder.Minimo) / 2);
                golpe.ModCorrente  = -(int)cDoAtacante.StatusTemporarios[numStatus].Quantificador;
            }
            else
            {
                golpe.ModCorrente = 0;
            }

            PetAttackDb golpePersonagem = cDoAtacante.GerenteDeGolpes.ProcuraGolpeNaLista(cDoAtacante.NomeID, golpe.Nome);

            CalculoC(multiplicador, golpe, golpePersonagem, potenciaDoAtacante, doAtacado, cDoAtacante);

            golpe.VerificaAplicaStatus(cDoAtacante, doAtacado);
        }
Exemplo n.º 15
0
        static void CalculoC(
            float multiplicador,
            PetAttackBase golpe,
            PetAttackDb golpePersonagem,
            int potenciaDoAtacante,
            PetManager doAtacado,
            PetBase cDoAtacado)
        {
            PetAtributes aDoAtacado = doAtacado.MeuCriatureBase.PetFeat.meusAtributos;
            float        rd         = Random.Range(0.85f, 1);
            int          level      = cDoAtacado.PetFeat.mNivel.Nivel;
            float        STAB       = 1;

            if (cDoAtacado.PetFeat.TemOTipo(golpe.Tipo))
            {
                STAB = 1.5f;
            }
            Debug.Log("modificador de potencia para esse golpe é " + golpePersonagem.ModPersonagem);
            //int  dano = (int)((((((((2 * level / 5) + 2) * potenciaDoAtacante* 20*(golpe.PotenciaCorrente+golpePersonagem.ModPersonagem) )/ aDoAtacado.Defesa.Corrente)/ 50) +2) *STAB * multiplicador) *rd / 100);
            int dano = (int)(((2 * level) * potenciaDoAtacante * (golpe.PotenciaCorrente + golpePersonagem.ModPersonagem) / (45f * aDoAtacado.Defesa.Corrente + 250) + 2) * STAB * multiplicador * rd);

            AplicaCalculoComVIsaoDeDano(doAtacado, golpe, aDoAtacado, multiplicador, dano, aDoAtacado.Defesa.Corrente, potenciaDoAtacante);
        }
Exemplo n.º 16
0
        void PreparaFinalSemCaptura()
        {
            ParticleOfSubstitution.ParticulaSaiDaLuva(CriatureAlvoDoItem.transform.position, GeneralParticles.captureEscape);
            CriatureAlvoDoItem.transform.localScale = new Vector3(1, 1, 1);
            //animator.SetBool("dano1", false);
            //animator.SetBool("dano2", false);
            MessageAgregator <MsgEndDamageState> .Publish(new MsgEndDamageState()
            {
                gameObject = CriatureAlvoDoItem
            });

            Debug.LogError("ota HUd");

            MessageAgregator <MsgRequestRapidInfo> .Publish(new MsgRequestRapidInfo()
            {
                message = string.Format(TextBank.RetornaFraseDoIdioma(TextKey.tentaCapturar),
                                        PetBase.NomeEmLinguas(FindByOwner.GetManagerEnemy(dono).MeuCriatureBase.NomeID))
            });

            //GameController.g.HudM.Painel.AtivarNovaMens(
            //   GameController.g.InimigoAtivo.MeuCriatureBase.NomeEmLinguas + BancoDeTextos.RetornaFraseDoIdioma(ChaveDeTexto.tentaCapturar),
            //    24, 5);
        }
Exemplo n.º 17
0
 public virtual void VerificaAplicaStatus(PetBase atacante, PetManager atacado)
 {
 }
Exemplo n.º 18
0
 public override void VerificaAplicaStatus(PetBase atacante, PetManager atacado)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 19
0
        public static PetBase GetPet(PetName nome)
        {
            PetBase retorno;

            switch (nome)
            {
            case PetName.Xuash:
                retorno = Xuash.Criature;
                break;

            case PetName.Florest:
                retorno = Florest.Criature;
                break;

            case PetName.PolyCharm:
                retorno = PolyCharm.Criature;
                break;

            case PetName.Arpia:
                retorno = Arpia.Criature;
                break;

            //case nomesCriatures.Iruin:
            //    retorno = IruinG2.Criature;
            //break;
            //case nomesCriatures.Urkan:
            //    retorno = UrkanG2.Criature;
            //break;
            //case nomesCriatures.Babaucu:
            //    retorno = MbBabaucu.Criature;
            //break;
            //case nomesCriatures.Serpente:
            //    retorno = MbSerpente.Criature;
            //break;
            //case nomesCriatures.Nessei:
            //    retorno = MbNessei.Criature;
            //    break;
            //case nomesCriatures.Cracler:
            //    retorno = MbCracler.Criature;
            //    break;
            //case nomesCriatures.Flam:
            //    retorno = MbFlam.Criature;
            //    break;
            //case nomesCriatures.Rocketler:
            //    retorno = MbRocketler.Criature;
            //    break;
            //case nomesCriatures.Baratarab:
            //    retorno = MbBaratarab.Criature;
            //    break;
            //case nomesCriatures.Aladegg:
            //    retorno = MbAladegg.Criature;
            //    break;
            //case nomesCriatures.Onarac:
            //    retorno = MbOnarac.Criature;
            //    break;
            //case nomesCriatures.Marak:
            //    retorno = MbMarak.Criature;
            //    break;
            //case nomesCriatures.Steal:
            //    retorno = MbSteal.Criature;
            //    break;
            //case nomesCriatures.Escorpion:
            //    retorno = MbEscorpion.Criature;
            //    break;
            //case nomesCriatures.Cabecu:
            //    retorno = MbCabecu.Criature;
            //    break;
            //case nomesCriatures.DogMour:
            //    retorno = MbDogMour.Criature;
            //    break;
            case PetName.Batler:
                retorno = Batler.Criature;
                break;

            //case nomesCriatures.Wisks:
            //    retorno = Wisks.Criature;
            //    break;
            //case nomesCriatures.Izicuolo:
            //    retorno = Izicuolo.Criature;
            //    break;
            default:
                retorno = new PetBase();
                break;
            }

            return(retorno);
        }
Exemplo n.º 20
0
 public static PetManager Initialize(PetBase pet, Vector3 pos)
 {
     return(Initialize(pet.NomeID, pet.PetFeat.mNivel.Nivel, pos));
 }