Exemplo n.º 1
0
 void SaveInfo()
 {
     for (int i = 0; i < SaveManager.instance.dinos.Count; i++)
     {
         DinoInfo dinoInfo = SaveManager.instance.dinos[i];
         if (id == i)
         {
             dinoInfo.healthPoint = health.HealthPoint;
             dinoInfo.sedatPoint  = sedat.SedatPoints;
             dinoInfo.position    = transform.position;
             break;
         }
     }
 }
Exemplo n.º 2
0
 void GetInfo()
 {
     for (int i = 0; i < SaveManager.instance.dinos.Count; i++)
     {
         DinoInfo dinoInfo = SaveManager.instance.dinos[i];
         if (id == i)
         {
             health.HealthPoint = dinoInfo.healthPoint;
             sedat.SedatPoints  = dinoInfo.sedatPoint;
             transform.position = dinoInfo.position;
             health.UpdateHealth(health.HealthPoint);
             break;
         }
     }
 }
Exemplo n.º 3
0
    public override void _Ready()
    {
        Instance = this;

        dinoList = new Dictionary <Enums.Dinos, PackedScene>()
        {
            { Enums.Dinos.Mega, GD.Load <PackedScene>("res://src/combat/dinos/MegaDino.tscn") },
            { Enums.Dinos.Tanky, GD.Load <PackedScene>("res://src/combat/dinos/TankyDino.tscn") },
            { Enums.Dinos.Warrior, GD.Load <PackedScene>("res://src/combat/dinos/WarriorDino.tscn") },
            { Enums.Dinos.Gator, GD.Load <PackedScene>("res://src/combat/dinos/GatorGecko.tscn") },
        };

        dinoIcons = new Dictionary <Enums.Dinos, StreamTexture>()
        {
            { Enums.Dinos.Mega, GD.Load <StreamTexture>("res://assets/dinos/mega_dino/mega_dino.png") },
            { Enums.Dinos.Tanky, GD.Load <StreamTexture>("res://assets/dinos/tanky_dino/Armored_Dino_ICON.png") },
            { Enums.Dinos.Warrior, GD.Load <StreamTexture>("res://assets/dinos/warrior_dino/Tribal_Dino_icon.png") },
            { Enums.Dinos.Gator, GD.Load <StreamTexture>("res://assets/dinos/gator_gecko/gator_gecko_icon.png") },
        };

        upgradesInfo = new Dictionary <Enums.Dinos, UpgradeInfo>()
        {
            { Enums.Dinos.Mega, new UpgradeInfo(GetDinoSaveLocation(Enums.Dinos.Mega)) },
            { Enums.Dinos.Tanky, new UpgradeInfo(GetDinoSaveLocation(Enums.Dinos.Tanky)) },
            { Enums.Dinos.Warrior, new UpgradeInfo(GetDinoSaveLocation(Enums.Dinos.Warrior)) },
            { Enums.Dinos.Gator, new UpgradeInfo(GetDinoSaveLocation(Enums.Dinos.Gator)) }
        };

        dinoTypesAndAbilities = new Dictionary <Enums.Dinos, Enums.SpecialAbilities>()
        {
            { Enums.Dinos.Mega, Enums.SpecialAbilities.None },
            { Enums.Dinos.Tanky, Enums.SpecialAbilities.IceProjectile },
            { Enums.Dinos.Warrior, Enums.SpecialAbilities.FireProjectile },
            { Enums.Dinos.Gator, Enums.SpecialAbilities.None },
        };

        specialAbilityIcons = new Dictionary <Enums.SpecialAbilities, StreamTexture>()
        {
            { Enums.SpecialAbilities.IceProjectile, GD.Load <StreamTexture>("res://assets/dinos/misc/ice.png") },
            { Enums.SpecialAbilities.FireProjectile, GD.Load <StreamTexture>("res://assets/dinos/misc/fire.png") },
        };

        specialAbilityVidPreviews = new Dictionary <Enums.SpecialAbilities, VideoStream>()
        {
            { Enums.SpecialAbilities.IceProjectile, GD.Load <VideoStream>("res://assets/abilities/previews/ice-preview.ogv") },
            { Enums.SpecialAbilities.FireProjectile, new VideoStreamWebm() },
        };
    }
Exemplo n.º 4
0
    public bool IsAbilityDeployable(Enums.Dinos dinoType)
    {
        DinoInfo d = DinoInfo.Instance;

        var  dinosLeft            = GetTree().GetNodesInGroup("dinos");
        bool specificDinoTypeLeft = false;

        foreach (BaseDino baseDino in dinosLeft)
        {
            if (baseDino.dinoType == dinoType)
            {
                specificDinoTypeLeft = true;
            }
        }

        // check for 3 things
        // 1. there are dinos of dinoType left that are still alive
        // 2. user has unlocked the special ability
        // 3. the associated ability for dinoType has not been used yet
        return(specificDinoTypeLeft && d.GetDinoInfo(dinoType).UnlockedSpecial() && !abilitiesUsed.Contains(DinoInfo.Instance.dinoTypesAndAbilities[dinoType]));
    }
Exemplo n.º 5
0
 public DinoInfo()
 {
     Instance = this;
 }