Exemple #1
0
    public GameObject GenerateLunen(Lunen species, int level, SortMovesType moveSort = SortMovesType.HighestFirst)
    {
        sr                      = GetComponent <SetupRouter>();
        New1                    = Instantiate(sr.database.MonsterTemplate);
        NewMonster1             = New1.GetComponent <Monster>();
        NewMonster1.sr          = sr;
        NewMonster1.Level       = level;
        NewMonster1.SourceLunen = species;
        NewMonster1.TemplateToMonster(species);
        switch (moveSort)
        {
        default: break;

        case SortMovesType.LowestFirst:
            NewMonster1.GetPreviousMoves();
            NewMonster1.SortMoves(false);
            break;

        case SortMovesType.HighestFirst:
            NewMonster1.GetPreviousMoves();
            NewMonster1.SortMoves(true);
            break;
        }

        return(New1);
    }
Exemple #2
0
    public void Evolve()
    {
        string PastLunenName = SourceLunen.name;

        SourceLunen = SourceLunen.EvolutionLunen;
        sr.eventLog.AddEvent(Nickname + " evolves into " + SourceLunen.name);
        TemplateToMonster(SourceLunen, (PastLunenName == Nickname));
    }
    public string GetLunenInfo(Monster monster = null, GameData.PlayerLunen gdMonster = null)
    {
        string setValue = "";

        if (monster != null)
        {
            setValue  = "Species: " + monster.SourceLunen.name;
            setValue += "\nType: " + monster.SourceLunen.Elements[0].name + (monster.SourceLunen.Elements.Count == 2 ? (" / " + monster.SourceLunen.Elements[1].name) : "");
            setValue += "\nLevel: " + monster.Level;
            if (monster.Level >= sr.database.LevelCap)
            {
                setValue += "\nEXP: Max Level";
            }
            else
            {
                setValue += "\nEXP: " + (monster.Exp.x - monster.Exp.y) + "/" + (monster.Exp.z - monster.Exp.y);
            }

            setValue += "\n";
            setValue += "\nHealth: " + monster.Health.z + "/" + monster.GetMaxHealth();
            setValue += "\nAttack: " + monster.Attack.z;
            setValue += "\nDefense: " + monster.Defense.z;
            setValue += "\nSpeed: " + monster.Speed.z;
            setValue += "\n";
            for (int i = 0; i < monster.ActionSet.Count; i++)
            {
                setValue += "\nMove " + (i + 1) + ": " + monster.ActionSet[i].Name;
            }
        }
        else if (gdMonster != null)
        {
            Lunen thisLunen = sr.database.IndexToLunen(gdMonster.species);
            setValue  = "Species: " + thisLunen.name;
            setValue += "\nType: " + thisLunen.Elements[0].name + (thisLunen.Elements.Count == 2 ? (" / " + thisLunen.Elements[1].name) : "");
            setValue += "\nLevel: " + gdMonster.level;
            if (gdMonster.level >= sr.database.LevelCap)
            {
                setValue += "\nEXP: Max Level";
            }
            else
            {
                setValue += "\nEXP: " + gdMonster.exp;
            }
            setValue += "\n";
            setValue += "\nHealth: " + (gdMonster.currentHealth) + "/" + (gdMonster.currentHealth);
            setValue += "\nAttack: " + (thisLunen.Attack.x + thisLunen.Attack.y * gdMonster.level);
            setValue += "\nDefense: " + (thisLunen.Defense.x + thisLunen.Defense.y * gdMonster.level);
            setValue += "\nSpeed: " + (thisLunen.Speed.x + thisLunen.Speed.y * gdMonster.level);
            setValue += "\n";

            for (int i = 0; i < gdMonster.learnedMoves.Count; i++)
            {
                setValue += "\nMove " + (i + 1) + ": " + sr.database.IndexToAction(gdMonster.learnedMoves[i]).Name;
            }
        }
        return(setValue);
    }
Exemple #4
0
 public int LunenToIndex(Lunen lunen)
 {
     for (int i = 0; i < AllLunen.Count; i++)
     {
         if (lunen == AllLunen[i])
         {
             return(i);
         }
     }
     return(-1);
 }
Exemple #5
0
    public void GenerateWildEncounter(Lunen species, int level)
    {
        EnemyLunenTeam.Clear();
        GameObject wildMonster = sr.generateMonster.GenerateLunen(species, level);
        Monster    wM          = wildMonster.GetComponent <Monster>();

        wM.MonsterTeam = Director.Team.EnemyTeam;
        EnemyLunenTeam.Add(wildMonster);
        wildMonster.transform.SetParent(this.transform);
        typeOfBattle = BattleType.WildEncounter;
        sr.database.SetTriggerValue("BattleVars/IsTrainerBattle", false);

        sr.canvasCollection.Player2BattleFieldSprites[0].DisableImage();
    }
 private void OnEnable()
 {
     lunen = (Lunen)target;
     scene = serializedObject.FindProperty("LearnedActions");
     list  = new ReorderableList(serializedObject, scene)
     {
         displayAdd         = true,
         displayRemove      = true,
         draggable          = true,
         drawHeaderCallback = rect =>
         {
             EditorGUI.LabelField(rect, "Learned Actions");
         },
         drawElementCallback = DrawListItems,
     };
 }
Exemple #7
0
    public void TemplateToMonster(Lunen template, bool rename = true)
    {
        SourceLunen = template;

        Health.x  = template.Health.x;
        Attack.x  = template.Attack.x;
        Defense.x = template.Defense.x;
        Speed.x   = template.Speed.x;

        Health.y  = template.Health.y * Level;
        Attack.y  = template.Attack.y * Level;
        Defense.y = template.Defense.y * Level;
        Speed.y   = template.Speed.y * Level;
        Health.z  = GetMaxHealth();
        CalculateStats();
        CalculateExpTargets();
        UpdateMoveCost();
        Exp.x = Exp.y;
        if (rename)
        {
            Nickname = template.name;
        }
        SetObjectName();
    }