private void Awake()
 {
     if (game != null)
     {
         Destroy(game);
     }
     else
     {
         game = this;
     }
     SkillPath.InitialiseSkillPaths();
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            SkillPath skillPath = new SkillPath("SkP1", "some description here");

            skillPath.id = 15;
            Console.WriteLine($"Skill path title: '{skillPath.title}' and Skill path description: '{skillPath.description}' and id: {skillPath.id}");

            Asset asset = new Asset("asset1", "some description for asset");

            asset.id = 108;
            Console.WriteLine($"asset title: '{asset.title}' and asset description: '{asset.description}' and id: {asset.id}");
            Console.ReadKey();
        }
    // run when player is created
    private void Start()
    {
        stats = SkillPath.skillPaths[0];

        health      = stats.maxHealth;
        healthRegen = stats.healthRegenRate;
        ability     = 0;
        level       = 0;
        path        = 0;
        SetHealthUI();
        SetAbilityUI();
        SetExpUI();
        stats.invulnerable = false;
        localPlayer        = Instantiate(playerPrefab, Vector2.zero, Quaternion.identity);
        playerPos          = localPlayer.transform;
        zombieKey          = false;
        demonKey           = false;
        ogreKey            = false;
    }
 public IActionResult OnGet(int?skillId)
 {
     SkillLevels = _htmlHelper.GetEnumSelectList <SkillLevel>();
     if (skillId.HasValue)
     {
         Heading   = "Edit ";
         Skill     = _skillData.GetSkillById(skillId.Value);
         SkillPath = new SkillPath();
     }
     else
     {
         Heading   = "Add New Skill";
         Skill     = new Skill();
         SkillPath = new SkillPath();
     }
     if (Skill == null)
     {
         return(RedirectToPage("/Shared/_NotFound"));
     }
     return(Page());
 }
Esempio n. 5
0
    public static SkillPath CreateSkillPath(GameObject go, Example.SkillPath.PathType type)
    {
        SkillPath path = null;

        switch (type)
        {
        case Example.SkillPath.PathType.NONE:
            path = go.AddComponent <NOPSkillPath> ();
            break;

        case Example.SkillPath.PathType.LINE:
            var linePath = go.AddComponent <LineSkillPath> ();
            linePath.startPos = CreateGameObject(go.transform, "Start").transform;
            linePath.endPos   = CreateGameObject(go.transform, "End").transform;
            path = linePath;
            break;

        case Example.SkillPath.PathType.FOLLOW:
            var followPath = go.AddComponent <FollowSkillPath> ();
            path = followPath;
            break;

        case Example.SkillPath.PathType.HELIX:
            var helixPath = go.AddComponent <HelixSkillPath> ();
            path = helixPath;
            break;

        case Example.SkillPath.PathType.FIXED_POSITION:
            var fixedPath = go.AddComponent <FixedPositionSkillPath> ();
            fixedPath.fixedPosition = CreateGameObject(go.transform, "FixedPosition").transform;
            path = fixedPath;
            break;
        }
        path.pathType = type;
        return(path);
    }
 public SkillPath AddNewSkillPath(SkillPath path)
 {
     throw new System.NotImplementedException();
 }
 public SkillPath AddNewSkillPath(SkillPath path)
 {
     _context.SkillPaths.Add(path);
     return(path);
 }
Esempio n. 8
0
    // hard coding in the values in order to work with WebGL
    public static void InitialiseSkillPaths()
    {
        skillPaths = new SkillPath[26];

        skillPaths[0] = new SkillPath
        {
            title             = "",
            description       = "",
            path              = 0,
            weapon            = Weapon.SWORD,
            weaponSprite      = "rusty_sword",
            special           = Special.NONE,
            character         = "man",
            maxHealth         = 50.0f,
            healthRegenRate   = 0,
            maxAbility        = 50.0f,
            abilityChargeRate = 0,
            abilityCost       = 20.0f,
            attacksPerSecond  = 2.0f,
            projectileForce   = 10.0f,
            projectileRange   = 6.0f,
            damageMin         = 5.0f,
            damageMax         = 10.0f,
            knockback         = 4.0f,
            shotSpread        = 0,
            parallel          = false,
            moveSpeed         = 3.0f,
            invulnerable      = false
        };

        skillPaths[1] = new SkillPath
        {
            title             = "Novice Archer",
            description       = "- Shoots a bow and arrow\n- Quicker Move Speed",
            path              = 0,
            weapon            = Weapon.BOW,
            weaponSprite      = "basic_bow",
            special           = Special.NONE,
            character         = "elf",
            maxHealth         = 50.0f,
            healthRegenRate   = 0,
            maxAbility        = 50.0f,
            abilityChargeRate = 0,
            abilityCost       = 20.0f,
            attacksPerSecond  = 1.5f,
            projectileForce   = 10.0f,
            projectileRange   = 6.0f,
            damageMin         = 5.0f,
            damageMax         = 8.0f,
            knockback         = 0.1f,
            shotSpread        = 0,
            parallel          = false,
            moveSpeed         = 3.5f,
            invulnerable      = false
        };

        skillPaths[2] = new SkillPath
        {
            title             = "Novice Knight",
            description       = "- Swings a sword for lots of damage\n- Has a higher max health",
            path              = 1,
            weapon            = Weapon.SWORD,
            weaponSprite      = "regular_sword",
            special           = Special.NONE,
            character         = "knight",
            maxHealth         = 75.0f,
            healthRegenRate   = 0f,
            maxAbility        = 50.0f,
            abilityChargeRate = 0,
            abilityCost       = 20.0f,
            attacksPerSecond  = 1.2f,
            projectileForce   = 10.0f,
            projectileRange   = 6.0f,
            damageMin         = 10.0f,
            damageMax         = 25.0f,
            knockback         = 8.0f,
            shotSpread        = 0,
            parallel          = false,
            moveSpeed         = 3.4f,
            invulnerable      = false
        };

        skillPaths[3] = new SkillPath
        {
            title             = "Novice Mage",
            description       = "- Shoots fireballs from his staff",
            path              = 2,
            weapon            = Weapon.STAFF,
            weaponSprite      = "red_magic_staff",
            special           = Special.NONE,
            character         = "wizard",
            maxHealth         = 50.0f,
            healthRegenRate   = 0,
            maxAbility        = 50.0f,
            abilityChargeRate = 0,
            abilityCost       = 20.0f,
            attacksPerSecond  = 0.8f,
            projectileForce   = 7.0f,
            projectileRange   = 6.0f,
            damageMin         = 6.0f,
            damageMax         = 10.0f,
            knockback         = 0.1f,
            shotSpread        = 0,
            parallel          = false,
            moveSpeed         = 3.0f,
            invulnerable      = false
        };

        skillPaths[4] = new SkillPath
        {
            title             = "Apprentice Archer",
            description       = "- Shoots three arrows at once\n- Can dash with SPACE",
            path              = 0,
            weapon            = Weapon.BOW,
            weaponSprite      = "basic_bow",
            special           = Special.DASH,
            character         = "elf",
            maxHealth         = 50.0f,
            healthRegenRate   = 0,
            maxAbility        = 50.0f,
            abilityChargeRate = 10f,
            abilityCost       = 30.0f,
            attacksPerSecond  = 1.3f,
            projectileForce   = 10.0f,
            projectileRange   = 6.0f,
            damageMin         = 4.0f,
            damageMax         = 7.0f,
            knockback         = 0.1f,
            shotSpread        = 3,
            parallel          = false,
            moveSpeed         = 3.5f,
            invulnerable      = false
        };

        skillPaths[5] = new SkillPath
        {
            title             = "Rookie Skirmisher",
            description       = "- Swings a hatchet\n- Can throw his hatchet with SPACE\n - Runs faster",
            path              = 1,
            weapon            = Weapon.SWORD,
            weaponSprite      = "axe",
            special           = Special.THROWSWORD,
            character         = "elf",
            maxHealth         = 60.0f,
            healthRegenRate   = 0f,
            maxAbility        = 50.0f,
            abilityChargeRate = 8f,
            abilityCost       = 30.0f,
            attacksPerSecond  = 2.5f,
            projectileForce   = 10.0f,
            projectileRange   = 6.0f,
            damageMin         = 12.0f,
            damageMax         = 18.0f,
            knockback         = 5.0f,
            shotSpread        = 0,
            parallel          = false,
            moveSpeed         = 4.0f,
            invulnerable      = false
        };

        skillPaths[6] = new SkillPath
        {
            title             = "Magically Inclined Knight",
            description       = "- Can throw a fireball with SPACE",
            path              = 2,
            weapon            = Weapon.SWORD,
            weaponSprite      = "regular_sword",
            special           = Special.FIREBALL,
            character         = "knight",
            maxHealth         = 75.0f,
            healthRegenRate   = 0f,
            maxAbility        = 50.0f,
            abilityChargeRate = 8f,
            abilityCost       = 25.0f,
            attacksPerSecond  = 1.8f,
            projectileForce   = 10.0f,
            projectileRange   = 6.0f,
            damageMin         = 12.0f,
            damageMax         = 17.0f,
            knockback         = 10.0f,
            shotSpread        = 0,
            parallel          = false,
            moveSpeed         = 3.5f,
            invulnerable      = false
        };

        skillPaths[7] = new SkillPath
        {
            title             = "Apprentice Mage",
            description       = "- Shoots fireballs from a much further distance\n -Shoots faster",
            path              = 3,
            weapon            = Weapon.STAFF,
            weaponSprite      = "red_magic_staff",
            special           = Special.NONE,
            character         = "wizard",
            maxHealth         = 50.0f,
            healthRegenRate   = 0,
            maxAbility        = 50.0f,
            abilityChargeRate = 0,
            abilityCost       = 20.0f,
            attacksPerSecond  = 1.1f,
            projectileForce   = 10.0f,
            projectileRange   = 12.0f,
            damageMin         = 8.0f,
            damageMax         = 12.0f,
            knockback         = 1.0f,
            shotSpread        = 0,
            parallel          = false,
            moveSpeed         = 3.5f,
            invulnerable      = false
        };
    }