Example #1
0
        public Person(string id, string name)
        {
            this.id   = id;
            this.name = name;

            way = -1;

            p_Hp   = 100;
            p_Mana = 100;

            p_Level    = 1;
            p_Exp_Need = 20;

            p_Class       = 0;
            p_Agility     = 0;
            p_Intelegence = 0;
            p_Strength    = 0;

            m_Defence = 3;
            m_Attack  = 10;

            p_Regen = 20f;

            p_Titul = "Нету";

            myTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;

            RecalkStat();
        }
Example #2
0
    public UnitClass Lookup(string n, UnitClass unitLookup)
    {
        switch (n)
        {
        case "attacker":
            cName   = className.className1;
            type    = classType.classType1;
            attack  = 2;
            defense = 1;
            cost    = 50;
            texture = textures[cName];
            unitLookup.unitSetup(cName, type, attack, defense, StateMachine.currentTurn(), cost, texture);
            return(unitLookup);

        case "defender":
            cName   = className.className2;
            type    = classType.classType2;
            attack  = 1;
            defense = 2;
            cost    = 25;
            texture = textures[cName];
            unitLookup.unitSetup(cName, type, attack, defense, StateMachine.currentTurn(), cost, texture);
            return(unitLookup);

        default:
            return(null);
        }
    }
Example #3
0
 public UnitClass()
 {
     uC           = className.className1;
     uT           = classType.classType1;
     att          = 0;
     def          = 0;
     owningPlayer = 0;
     pointCost    = 0;
     unitTexture  = null;
 }
Example #4
0
 public void unitSetup(className cn, classType ct, float a, float d, int pl, int p, Texture tex)
 {
     uC           = cn;
     uT           = ct;
     att          = a;
     def          = d;
     owningPlayer = pl;
     pointCost    = p;
     texture      = tex;
     TextureManager.applyTexture(this.gameObject, texture);
 }
    //Use our current star levels to light up stars, buttons.
    public void CheckStars(QuizButton a_button)
    {
        if (!list)
        {
            list = FindObjectOfType <equipmentList>();
        }
        if ((int)a_button.Operator > (int)classType.Calculi)
        {
            currentSubject = classType.Calculi;
        }
        else
        {
            currentSubject = (classType)a_button.Operator;
        }


        SetupGroups((int)currentSubject);

        starsUnlocked = list.equip.StarsAcquired[(((int)currentSubject * 10) + currentLevel)];
        if (currentLevel == 4 || currentLevel == 9 || currentLevel == 14)
        {
            SetHardMode(false);

            medal.gameObject.SetActive(true);

            medal.SetChangingTalisman(list, talismanManager, currentSubject);

            BossButton.gameObject.SetActive(true);
            NormalMode.gameObject.SetActive(false);
            HardButton.gameObject.SetActive(false);
            starOne.gameObject.SetActive(false);
            starTwo.gameObject.SetActive(false);
            starThree.gameObject.SetActive(false);
            bronzestarParticle.gameObject.SetActive(false);
            silverstarParticle.gameObject.SetActive(false);
            goldstarParticle.gameObject.SetActive(false);
            return;
        }
        NormalMode.gameObject.SetActive(true);
        BossButton.gameObject.SetActive(false);
        medal.gameObject.SetActive(false);
        HardButton.gameObject.SetActive(true);
        starOne.gameObject.SetActive(true);
        starTwo.gameObject.SetActive(true);
        starThree.gameObject.SetActive(true);
        starOne.interactable    = (starsUnlocked >= 1);
        starTwo.interactable    = (starsUnlocked >= 2);
        HardButton.interactable = ((starsUnlocked >= 2) && currentContainer.buttons[currentLevel].hardMode != null);

        starThree.interactable = (starsUnlocked >= 3);
        bronzestarParticle.SetActive(starOne.interactable);
        silverstarParticle.SetActive(starTwo.interactable);
        goldstarParticle.SetActive(starThree.interactable);
    }
Example #6
0
 public void unitSetup(UnitClass copy)
 {
     uC           = copy.unitClass;
     uT           = copy.unitType;
     att          = copy.attack;
     def          = copy.defense;
     owningPlayer = copy.owner;
     pointCost    = copy.cost;
     texture      = copy.texture;
     TextureManager.applyTexture(this.gameObject, texture);
 }
    internal void SetSprite(classType subject)
    {
        Sprite[] newSprite = null;

        switch (subject)
        {
        case classType.Addition:
            newSprite = AdditionSprite;
            break;

        case classType.Subtraction:
            newSprite = SubtractionSprite;
            break;

        case classType.Multiplication:
            newSprite = MultiplicationSprite;
            break;

        case classType.Division:
            newSprite = DivisionSprite;
            break;

        case classType.Calculi:
            newSprite = CalculusSprite;
            break;
        }
        if (newSprite == null)
        {
            foreach (Image item in Buttons)
            {
                item.sprite = DefaultSprite;
            }
            return;
        }

        for (int i = 0; i < Buttons.Length; i++)
        {
            if (i >= newSprite.Length)
            {
                Buttons[i].sprite = DefaultSprite;
                continue;
            }
            if (newSprite[i] == null)
            {
                Buttons[i].sprite = DefaultSprite;
                continue;
            }
            Buttons[i].sprite = newSprite[i];
        }
    }
    //Open up the script by setting up variables relative to selection.
    public void setContainer(questionContainer op)
    {
        currentContainer = op;
        currentSubject   = op.type;

        currentLevel = 0;
        gameObject.SetActive(true);
        CheckStars(op.buttons[0]);
        op.gameObject.SetActive(false);

        SetButtons();

        ChangeIndex(currentLevel);
    }
Example #9
0
    public void SetImage()
    {
        classType type = classType.Addition;

        type = levelSelection.currentSubject;

        //int index = (int)type;

        switch (type)
        {
        case classType.Addition:
            HelpPanel.sprite = HelpImages[0];
            break;

        case classType.Subtraction:
            HelpPanel.sprite = HelpImages[1];
            break;

        case classType.Multiplication:
            HelpPanel.sprite = HelpImages[2];
            break;

        case classType.Division:
            HelpPanel.sprite = HelpImages[3];
            break;

        case classType.Calculi:
            if (levelSelection.currentLevel > 7)
            {
                HelpPanel.sprite = FortTen;
            }
            else
            {
                HelpPanel.sprite = HelpImages[4];
            }
            break;

        default:
            return;
        }
        HelpPanel.gameObject.SetActive(true);

        moveArrows.SetActive(false);
    }
Example #10
0
 public void unitSetup(UnitClass copy)
 {
     unitTexture  = new Texture[2];
     uC           = copy.unitClass;
     uT           = copy.unitType;
     att          = copy.attack;
     def          = copy.defense;
     owningPlayer = copy.owner;
     pointCost    = copy.cost;
     texture[0]   = copy.texture[0];
     texture[1]   = copy.texture[1];
     if (owningPlayer == 1)
     {
         TextureManager.applyTexture(this.gameObject, texture[0]);
     }
     if (owningPlayer == 2)
     {
         TextureManager.applyTexture(this.gameObject, texture[1]);
     }
 }
Example #11
0
 public void unitSetup(className cn, classType ct, float a, float d, int pl, int p, Texture[] tex)
 {
     unitTexture  = new Texture[2];
     uC           = cn;
     uT           = ct;
     att          = a;
     def          = d;
     owningPlayer = pl;
     pointCost    = p;
     texture[0]   = tex[0];
     texture[1]   = tex[1];
     if (owningPlayer == 1)
     {
         TextureManager.applyTexture(this.gameObject, texture[0]);
     }
     if (owningPlayer == 2)
     {
         TextureManager.applyTexture(this.gameObject, texture[1]);
     }
 }
    //Called from player if we won.
    //If we won, 1 star.
    //If we were at 100% health, 2 stars.
    //If it was hardmode, 3.
    public void SetStars(bool fullHealth, QuizButton a_button)
    {
        if (!list)
        {
            list = FindObjectOfType <equipmentList>();
        }

        if (a_button.boss)
        {
            return;
        }

        currentLevel = a_button.quizIndex;
        if ((int)a_button.Operator > (int)classType.Calculi)
        {
            currentSubject = classType.Calculi;
        }
        else
        {
            currentSubject = (classType)a_button.Operator;
        }


        starsUnlocked = list.equip.StarsAcquired[(((int)currentSubject * 10) + currentLevel)];
        if (starsUnlocked == 0)
        {
            starsUnlocked = 1;
        }
        if (fullHealth && starsUnlocked < 2)
        {
            starsUnlocked = 2;
        }
        if (a_button.Hard)
        {
            starsUnlocked = 3;
        }
        list.equip.StarsAcquired[(((int)currentSubject * 10) + currentLevel)] = starsUnlocked;
        CheckStars(a_button);

        SetButtons();
    }
    internal void SetSprite(classType subject)
    {
        Sprite newSprite = null;

        switch (subject)
        {
        case classType.Addition:
            newSprite = AdditionSprite;
            break;

        case classType.Subtraction:
            newSprite = SubtractionSprite;
            break;

        case classType.Multiplication:
            newSprite = MultiplicationSprite;
            break;

        case classType.Division:
            newSprite = DivisionSprite;
            break;

        case classType.Calculi:
            newSprite = CalculusSprite;
            break;

        default:
            newSprite = DefaultSprite;
            break;
        }
        if (newSprite == null)
        {
            newSprite = DefaultSprite;
        }

        foreach (Image item in Buttons)
        {
            item.sprite = newSprite;
        }
    }
Example #14
0
    internal void SetChangingTalisman(equipmentList list, TalismanManager talismanManager, classType a_type)
    {
        if (!MainButton)
        {
            MainButton = GetComponent <Image>();
            HalfButton = GetComponentsInChildren <Image>()[1];
        }

        myType = a_type;

        if (myType == classType.Calculi)
        {
            gameObject.SetActive(false);
            return;
        }

        MainButton.sprite = talismanManager.ReturnSubject(myType, false);
        HalfButton.sprite = talismanManager.ReturnSubject(myType, true);

        int index = list.equip.completedLevels[(int)myType];

        SetActivity(index);
    }
Example #15
0
    public void Lookup(string n)
    {
        switch (n)
        {
        case "King":
            cName       = className.King;
            type        = classType.classType1;
            attack      = 2;
            defense     = 20;
            cost        = 0;
            description = "The Leaders of their respective forces; Kings are to be protected at all costs. When your King dies, you lose.";
            //If it is knocked off of the board or defeated, it's owner loses the game. Limit: 1 per player per round.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Brawler":
            cName       = className.Brawler;
            type        = classType.classType1;
            attack      = 3;
            defense     = 2;
            cost        = 3;
            description = "Your basic attacking unit. Good for throwing at your opponent repeatedly.";
            //If it lands on your side of the field after the initial flick, it can be flicked a second time in the same turn.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Sentinel":
            cName       = className.Sentinel;
            type        = classType.classType1;
            attack      = 2;
            defense     = 4;
            cost        = 4;
            description = "An excellent defender. Holds the line and can clear your side of the field.";
            // No ability.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Shadow":
            cName       = className.Shadow;
            type        = classType.classType1;
            attack      = 4;
            defense     = 1;
            cost        = 3;
            description = "An espionage expert. This piece can disappear if it lands on your opponent's side, and reappear later!";
            //If it lands on opponent's side of the field at the end of your turn, you may remove from play. Use your flick action to place on board on a later turn.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Grunt":
            cName       = className.Grunt;
            type        = classType.classType1;
            attack      = 2;
            defense     = 2;
            cost        = 3;
            description = "A basic utility unit that is cheap and effective.";
            //No ability.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Peasant":
            cName       = className.Peasant;
            type        = classType.classType1;
            attack      = 1;
            defense     = 1;
            cost        = 1;
            description = "Not intended for combat, but very expendable. These units are best used as a wall from enemy attacks.";
            //May be flicked twice in the same turn. Limit: 3 per player per round.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Healer":
            cName       = className.Healer;
            type        = classType.classType1;
            attack      = 0;
            defense     = 6;
            cost        = 4;
            description = "This piece can be sacrificed in order too return destroyed pieces to your side of the field.";
            //Can not be flicked. Can be sacrificed to return up to 6 cost worth of troops from the dead to your side of the field (depends on coin toss per attempted piece). Limit: 1 per player per round.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Paralyze":
            cName       = className.Paralyze;
            type        = classType.classType1;
            attack      = 0;
            defense     = 1;
            cost        = 2;
            description = "A spell to stop your opponent from utilizing any unit it is in combat with.";
            //Can only be placed on top of an opponent's cube instead of using a flicking action. Stops that cube from being used. Must be flicked off to remove effect.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Titan":
            cName       = className.Titan;
            type        = classType.classType1;
            attack      = 6;
            defense     = 4;
            cost        = 7;
            description = "A colossal offensive unit. This expensive piece is to be feared.";
            //No ability.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Bomb":
            cName       = className.Bomb;
            type        = classType.classType1;
            attack      = 0;
            defense     = 2;
            cost        = 4;
            description = "KABOOOOOOOOOOOOOOOOOOOOOOOOOOM!!!";
            //Use flicking action to detonate, creating an area of effect collision. Limit: 1 per player per round.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        default:
            cName = className.Null;
            break;
        }
    }
Example #16
0
    public void Lookup(string n)
    {
        switch (n)
        {
        case "King":
            cName       = className.King;
            type        = classType.classType1;
            attack      = 2;
            defense     = 20;
            cost        = 0;
            description = "";
            //If it is knocked off of the board or defeated, it's owner loses the game. Limit: 1 per player per round.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Brawler":
            cName       = className.Brawler;
            type        = classType.classType1;
            attack      = 3;
            defense     = 1;
            cost        = 4;
            description = "";
            //If it lands on your side of the field after the initial flick, it can be flicked a second time in the same turn.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Sentinel":
            cName       = className.Sentinel;
            type        = classType.classType1;
            attack      = 2;
            defense     = 3;
            cost        = 4;
            description = "";
            // No ability.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Shadow":
            cName       = className.Shadow;
            type        = classType.classType1;
            attack      = 1;
            defense     = 2;
            cost        = 3;
            description = "";
            //If it lands on opponent's side of the field at the end of your turn, you may remove from play. Use your flick action to place on board on a later turn.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Grunt":
            cName       = className.Grunt;
            type        = classType.classType1;
            attack      = 1;
            defense     = 1;
            cost        = 2;
            description = "";
            //No ability.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Peasant":
            cName       = className.Peasant;
            type        = classType.classType1;
            attack      = 0;
            defense     = 1;
            cost        = 1;
            description = "";
            //May be flicked twice in the same turn. Limit: 3 per player per round.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Healer":
            cName       = className.Healer;
            type        = classType.classType1;
            attack      = 0;
            defense     = 6;
            cost        = 4;
            description = "";
            //Can not be flicked. Can be sacrificed to return up to 6 cost worth of troops from the dead to your side of the field (depends on coin toss per attempted piece). Limit: 1 per player per round.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Paralyze":
            cName       = className.Paralyze;
            type        = classType.classType1;
            attack      = 0;
            defense     = 1;
            cost        = 2;
            description = "";
            //Can only be placed on top of an opponent's cube instead of using a flicking action. Stops that cube from being used. Must be flicked off to remove effect.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        case "Titan":
            cName       = className.Titan;
            type        = classType.classType1;
            attack      = 3;
            defense     = 4;
            cost        = 7;
            description = "";
            //No ability.
            texture[0] = p1Textures[cName];
            texture[1] = p2Textures[cName];
            break;

        default:
            cName = className.Null;
            break;
        }
    }
Example #17
0
 public PlayerClass(string name)
 {
     if ((name == "Minstril") ||
         (name == "Troubadour") ||
         (name == "Virtuoso") ||
         (name == "Bard"))
     {
         type = classType.Bard;
         return;
     }
     if ((name == "Vicar") ||
         (name == "Templar") ||
         (name == "High Priest") ||
         (name == "Cleric"))
     {
         type = classType.Cleric;
         return;
     }
     if ((name == "Wanderer") ||
         (name == "Preserver") ||
         (name == "Hierophant") ||
         (name == "Druid"))
     {
         type = classType.Druid;
         return;
     }
     if ((name == "Illusionist") ||
         (name == "Beguiler") ||
         (name == "Phantasnist") ||
         (name == "Enchanter"))
     {
         type = classType.Enchanter;
         return;
     }
     if ((name == "Elementalist") ||
         (name == "Conjurer") ||
         (name == "Arch Mage") ||
         (name == "Magician"))
     {
         type = classType.Magician;
         return;
     }
     if ((name == "Disciple") ||
         (name == "Master") ||
         (name == "Grandmaster") ||
         (name == "Monk"))
     {
         type = classType.Monk;
         return;
     }
     if ((name == "Heretic") ||
         (name == "Defiler") ||
         (name == "Warlock") ||
         (name == "Necromancer"))
     {
         type = classType.Necromancer;
         return;
     }
     if ((name == "Cavalier") ||
         (name == "Knight") ||
         (name == "Crusader") ||
         (name == "Paladin"))
     {
         type = classType.Paladin;
         return;
     }
     if ((name == "Pathfinder") ||
         (name == "Outrider") ||
         (name == "Warder") ||
         (name == "Ranger"))
     {
         type = classType.Ranger;
         return;
     }
     if ((name == "Rake") ||
         (name == "Blackguard") ||
         (name == "Assassin") ||
         (name == "Rogue"))
     {
         type = classType.Rogue;
         return;
     }
     if ((name == "Reaver") ||
         (name == "Revenant") ||
         (name == "Grave Lord") ||
         (name == "ShadowKnight"))
     {
         type = classType.ShadowKnight;
         return;
     }
     if ((name == "Mystic") ||
         (name == "Luminary") ||
         (name == "Oracle") ||
         (name == "Shaman"))
     {
         type = classType.Shaman;
         return;
     }
     if ((name == "Champion") ||
         (name == "Myrmidon") ||
         (name == "Warlord") ||
         (name == "Warrior"))
     {
         type = classType.Warrior;
         return;
     }
     if ((name == "Channeler") ||
         (name == "Evoker") ||
         (name == "Sorcerer") ||
         (name == "Wizard"))
     {
         type = classType.Wizard;
         return;
     }
     throw new Exception("Bad class name.");
 }
Example #18
0
 public HtmlStyle GetClass(string classname,classType typeclass)
 {
     var s = from st in listClass
             where st.Name == classname && st.TypeOfClass == typeclass
             select st.CssClass;
     if (s != null)
         if (s.Count() > 0)
             return s.First();
     return null;
 }
Example #19
0
        public bool AddClass(string classname, HtmlStyle style, classType typeOfClass)
        {
            var s = from st in listClass
                    where st.Name == classname
                    select st;

            if (s != null)
                if (s.Count() > 0)
                    return false;

            ListClass.Add(new ClassCss() { CssClass = style, Name = classname, TypeOfClass = typeOfClass });
            return true;
        }
 var(disposableMethods, finalizer) = CreateDisposableMethods(compilation, document, classType, disposeMethod, disposedValueField);
Example #21
0
    internal Sprite ReturnSubject(classType subject, bool half)
    {
        Sprite returnSprite = null;

        switch (subject)
        {
        case classType.Addition:
            if (half)
            {
                returnSprite = AddHalf;
            }
            else
            {
                returnSprite = AddFull;
            }
            break;

        case classType.Subtraction:
            if (half)
            {
                returnSprite = SubHalf;
            }
            else
            {
                returnSprite = SubFull;
            }
            break;

        case classType.Multiplication:
            if (half)
            {
                returnSprite = MultHalf;
            }
            else
            {
                returnSprite = MultFull;
            }
            break;

        case classType.Division:
            if (half)
            {
                returnSprite = DivHalf;
            }
            else
            {
                returnSprite = DivFull;
            }
            break;

        case classType.Calculi:
            if (half)
            {
                returnSprite = FortHalf;
            }
            else
            {
                returnSprite = FortFull;
            }
            break;

        default:
            break;
        }
        if (returnSprite == null)
        {
            return(defaultSprite);
        }
        else
        {
            return(returnSprite);
        }
    }