public GameObject GetElementView(IElementalType eType, int size)
 {
     var gO= gM.LoadViaResources("UnitElementBall");
     gO.GetComponent<Renderer>().material.color = eType.GetColor();
     gO.transform.localScale = gO.transform.localScale * (0.7f* Mathf.Sqrt(size));
     return gO;
 }
Exemplo n.º 2
0
        public IslandElement GetWizard(IElementalType eType, Island visIsland, Vector3 pos, Team team)
        {
            var wizard = GetDefaultUnit(visIsland, pos, team);

            wizard.IslandElementViewSettings = new IslandElementViewSettings()
            {
                GetGameObject = () => viewFac.GetWizardVisualization(), HasLifeStatVisualization = true
            };
            wizard.hasLight = true;
            var elementalInfo = eType.IsWater ? new ElementalInfo(13, 13, 16, 11, 13) : new ElementalInfo(eType, 2);

            wizard.ElementalController.SetInfo(elementalInfo, eType, true);
            wizard.HarvestController.SetHarvestSettings(new HumanHarvestControllerTactic(wizard), new HarvestInfo(false, false, null, null, true, true, true, true));
            wizard.MaxSpeed = 6f;
            wizard.LifeController.SetLifePoints(50, 50);
            wizard.MagicController.EnableMagic(70, 100);
            wizard.HydrationController.EnableDehydrating(60, 80, 80);
            wizard.FightingController.EnableAttack(3, 6);
            wizard.InventoryController.HasInventory = true;
            wizard.ItemUsageController.usageTactic  = new WizardItemUsageControllerTactic(inventoryDb);
            return(wizard);
        }
Exemplo n.º 3
0
 public ElementalInfo(IElementalType mainType, int level)
 {
     if (mainType.IsLightning)
     {
         LightningLevel = level;
     }
     if (mainType.IsMagma)
     {
         MagmaLevel = level;
     }
     if (mainType.IsToxic)
     {
         ToxicLevel = level;
     }
     if (mainType.IsWater)
     {
         WaterLevel = level;
     }
     if (mainType.IsPsychic)
     {
         PsychicLevel = level;
     }
 }
Exemplo n.º 4
0
 public float DamageMultiplierAgainst(IElementalType other)
 {
     if (other.GetName() == Psychic.SGetName())
     {
         return(1f);
     }
     if (other.GetName() == Lightning.SGetName())
     {
         return(3f);
     }
     if (other.GetName() == Water.SGetName())
     {
         return(0.5f);
     }
     if (other.GetName() == Magma.SGetName())
     {
         return(1);
     }
     if (other.GetName() == Toxic.SGetName())
     {
         return(0.5f);
     }
     throw new Exception();
 }
Exemplo n.º 5
0
 public void SetInfo(ElementalInfo info, IElementalType type, bool hasView = false)
 {
     SetInfo(info);
     elem.ElementalType    = type;
     elem.hasElementalView = hasView;
 }