Exemple #1
0
    void Start()
    {
        ContextManager.ContextChanged += HandleContextChangedEvent;

        GameObject army1 = new GameObject();

        army1.AddComponent <ArmyData>();
        army1.GetComponent <ArmyData>().Initialize("Player");
        army1.GetComponent <ArmyData>().AddCharacterToArmy(CharacterGenerator.GenerateCharacter().GetComponent <CharacterData>());

        GameObject army2 = new GameObject();

        army2.AddComponent <ArmyData>();
        army2.GetComponent <ArmyData>().Initialize("Enemy");
        army2.GetComponent <ArmyData>().AddCharacterToArmy(CharacterGenerator.GenerateCharacter().GetComponent <CharacterData>());

        army1.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f);
        army2.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f);

        BoardManager.MoveToHex(army1.GetComponentInChildren <CharacterData>(), BoardManager.FindSummit(BoardManager.GetHex(0, 0, 0)));
        BoardManager.MoveToHex(army2.GetComponentInChildren <CharacterData>(), BoardManager.FindSummit(BoardManager.GetHex(0, 0, 2)));

        TurnManager.GenerateInitiativeOrder(new List <ArmyData>()
        {
            army1.GetComponent <ArmyData>(), army2.GetComponent <ArmyData>()
        });

        BeginBattle();
    }
Exemple #2
0
    public void RandomizeCharacter()
    {
        Debug.Log("Randomizing");
        Character newChar = CharacterGenerator.GenerateCharacter(false, currChar.Speciality);

        playerFaction.characters[currButton.charId] = newChar;
        currChar = newChar;
        Debug.Log("Current Character Speciality: " + currChar.Speciality + "!!!");
        StartCoroutine(LoadCharacteristics());
        StartCoroutine(LoadCharacters());
    }
Exemple #3
0
    public void OnStart()
    {
        Character newChar = CharacterGenerator.GenerateCharacter(false, Character.CharacterSpeciality.Scientist);

        // Debug.Log(newChar.characteristics.Count + "?!");
        newChar.characterName = NameGenerator.Instance.getName();
        GameManager.Instance.SetPlayerFaction(FactionStorage.Instance.EuropaFaction);
        Faction faction = GameManager.Instance.playerFaction;

        Debug.Log(faction.factionName + ": Fuel: " + faction.fuel.resourceQuantity + " , Food: " + faction.food.resourceQuantity + " , Water: " + faction.water.resourceQuantity + " , Materials: " + faction.material.resourceQuantity);
        foreach (FactionRelationship relation in GameManager.Instance.playerFaction.relationships)
        {
            Debug.Log(GameManager.Instance.playerFaction.factionName + " relationship with: " + relation.faction.factionName + " State: " + relation.RelationState + " trade: " +
                      relation.tradeModifier + " info: " + relation.informationModifier + " overall: " + relation.relationshipRating);
        }
    }
Exemple #4
0
 public void GenerateStartingCharacters()
 {
     for (int i = 0; i < startCharacters; i++)
     {
         if (i == 0)
         {
             Character newChar = CharacterGenerator.GenerateCharacter(true, Character.CharacterSpeciality.Scientist);
             leader = newChar;
             characters.Add(newChar);
         }
         else
         {
             Character newChar = CharacterGenerator.GenerateCharacter(false, Character.CharacterSpeciality.Scientist);
             characters.Add(newChar);
         }
     }
 }
Exemple #5
0
        static Character MakeCharacter(CharacterGenerator characterGenerator, Dice dice,
                                       string selectedArchetype, string selectedRank, string selectedRace)
        {
            var options = new CharacterOptions(characterGenerator);

            //Archetypes
            if (selectedArchetype == null)
            {
                options.SelectedArchetype = null;
            }
            else
            {
                options.SelectedArchetype = characterGenerator.Archetypes.SingleOrDefault(a => a.Name == selectedArchetype);
            }

            //Ranks
            if (selectedRank == null)
            {
                options.SelectedRank = null;
            }
            else
            {
                options.SelectedRank = characterGenerator.Ranks.SingleOrDefault(a => a.Name == selectedRank);
            }

            //Race
            if (selectedRace == null)
            {
                options.SelectedRace = null;
            }
            else
            {
                options.SelectedRace = characterGenerator.Races.SingleOrDefault(a => a.Name == selectedRace);
            }

            return(characterGenerator.GenerateCharacter(options, dice));
        }
    public void ShowCharacterData(int id, bool reset_character)
    {
        //print("--ShowCharacterData " + id + " " + reset_character + " " + PlayerInfo.Instance.charImageID);
        character_id = id;

        overwritingAlert         = false;
        StartGameButtonText.text = (SaveLoadXML.HasKey("PLAYER_INFO") && character_id == GameData.current.currentCharacterID) ? Localization.Instance.GetLocale(32) : Localization.Instance.GetLocale(645);

        //if (MainMenu.Instance.charactersList[id].cost > GameData.current.characterPoints)
        if (character_id == 0 || GameData.current.HasCharacterCompleted(id - 1))
        {
            StartGameButton.SetActive(true);

            if (SaveLoadXML.HasKey("PLAYER_INFO") && !reset_character)
            {
                PlayerInfo.Instance.LoadGame();
                if (character_id == GameData.current.currentCharacterID)
                {
                    //print(0);
                    RestartGameButton.SetActive(true);
                }
                else
                {
                    //print(1);
                    overwritingAlert = true;
                    RestartGameButton.SetActive(false);
                    CharacterGenerator.GenerateCharacter(id);
                }
            }
            else
            {
                //print(2);
                RestartGameButton.SetActive(false);
                CharacterGenerator.GenerateCharacter(id);
            }
        }
        else
        {
            //print(3);
            StartGameButton.SetActive(false);
            RestartGameButton.SetActive(false);

            CharacterGenerator.GenerateCharacter(id);
        }


        SelectedCharacterImage.sprite = SpriteManager.Instatce.GetSprite("Pers/pers_" + character_id);        //MainMenu.Instance.CharacterImageList[id];
//		SelectedCharacterNumber.text = PlayerInfo.Instance.characterNumber;

        BodyText.text      = Localization.Instance.GetLocale(57) + ": ";
        BodyValueText.text = Mathf.FloorToInt(PlayerInfo.Instance.body) + "/" + PlayerInfo.Instance.max_str;

        CharismaText.text      = Localization.Instance.GetLocale(58) + ": ";
        CharismaValueText.text = Mathf.FloorToInt(PlayerInfo.Instance.charisma) + "/" + PlayerInfo.Instance.max_dex;

        MindText.text      = Localization.Instance.GetLocale(59) + ": ";
        MindValueText.text = Mathf.FloorToInt(PlayerInfo.Instance.mind) + "/" + PlayerInfo.Instance.max_int;

        InmateRepText.text      = Localization.Instance.GetLocale(61) + ": ";
        InmateRepValueText.text = Mathf.FloorToInt(PlayerInfo.Instance.inmate_rep) + "/200";

        GuardRepText.text       = Localization.Instance.GetLocale(60) + ": ";
        GuardrRepValueText.text = Mathf.FloorToInt(PlayerInfo.Instance.guard_rep) + "/200";

        CharacterNameText.text = Localization.Instance.GetLocale(MainMenu.Instance.charactersList [id].name_id);
        StoryLabel.text        = Localization.Instance.GetLocale(MainMenu.Instance.charactersList [id].story_name_id); //882
        //StoryLabelText.text = "<color=#147832>" + Localization.Instance.GetLocale(957) + "</color>" + ":";
        StoryText.text    = Localization.Instance.GetLocale(MainMenu.Instance.charactersList [id].story_id);           //883
        SentenceText.text = Localization.Instance.GetLocale(883) + " " + MainMenu.Instance.charactersList [id].sentence + " " + Localization.Instance.GetLocale(884) + ".";


        TraitsText.text = Localization.Instance.GetLocale(56) + ":\n";         // "<color=blue>" + "</color>" +

        List <Trait> traitList = PlayerInfo.Instance.traitList.FindAll(t => t.status);

        if (traitList.Count > 0)
        {
            int i = 0;
            foreach (Trait trait in traitList)
            {
                TraitsText.text += Localization.Instance.GetLocale(trait.text_id);
                if (i++ < traitList.Count - 1)
                {
                    TraitsText.text += ", ";
                }
            }

            TraitsText.text += ".";
        }
        else
        {
            TraitsText.text += Localization.Instance.GetLocale(69);
        }
    }