Exemple #1
0
 private void Start()
 {
     speciesList.Display(GameDataManager.instance.Species);
     speciesList.OnListElementSelectedEvent       += SpeciesListChange;
     portraitGenerator.OnLayeredSpriteChangeEvent += PortraitGeneratorChange;
     speciesList.ForceSelect(0);
     firstName.onValueChanged.AddListener(SetPlayerFirstName);
     lastName.onValueChanged.AddListener(SetPlayerLastName);
     firstName.text = StringLoader.GetAString("FirstNamesMasculine");
     lastName.text  = StringLoader.GetAString("LastNames");
 }
Exemple #2
0
    public static Shield GetRandomShield()
    {
        Shield p = new Shield();

        p.sprite             = SpriteLoader.GetPartSprite("defaultShieldS");
        p.Tier               = 1;
        p.Size               = PartSize.S;
        p.shieldType         = ShieldType.Generator;
        p.DescriptionName    = "Shield Generator";
        p.ModelName          = StringLoader.GetAString("sensorNames");
        p.strength.Value     = UnityEngine.Random.Range(2, 20);
        p.rechargeTime.Value = UnityEngine.Random.Range(20, 100);
        return(p);
    }
Exemple #3
0
    public static Sensor GetRandomSensor()
    {
        Sensor p = new Sensor();

        p.sprite           = SpriteLoader.GetPartSprite("defaultSensorS");
        p.Tier             = 1;
        p.Size             = PartSize.S;
        p.sensorType       = SensorType.LowEnergy;
        p.DescriptionName  = "Low Energy Sensor";
        p.ModelName        = StringLoader.GetAString("sensorNames");
        p.range.Value      = UnityEngine.Random.Range(2, 20);
        p.resolution.Value = UnityEngine.Random.Range(2, 20);
        return(p);
    }
Exemple #4
0
    public static Engine GetRandomEngine()
    {
        Engine p = new Engine();

        p.sprite              = SpriteLoader.GetPartSprite("defaultEngineS");
        p.Tier                = Random.Range(1, 6);
        p.agility.Value       = Random.Range(1, 20);
        p.Size                = PartSize.S;
        p.averageThrust.Value = Random.Range(1, 20);
        p.DescriptionName     = Constants.GetPartDescriptionName(p);
        p.ModelName           = StringLoader.GetAString("engineNames");
        Debug.Log(p.GetDescriptionString());
        Debug.Log(p.GetStatisticsString());
        return(p);
    }
Exemple #5
0
    public static FireControl GetRandomFireControl()
    {
        FireControl p = new FireControl();

        p.sprite          = SpriteLoader.GetPartSprite("defaultFireControlS");
        p.tier            = Random.Range(1, 6);
        p.tracking.Value  = Random.Range(1, 20);
        p.accuracy.Value  = Random.Range(1, 20);
        p.Size            = PartSize.S;
        p.range.Value     = Random.Range(1, 20);
        p.DescriptionName = "Fire Control System";
        p.ModelName       = StringLoader.GetAString("fireControlNames");
        Debug.Log(p.GetDescriptionString());
        Debug.Log(p.GetStatisticsString());
        return(p);
    }
Exemple #6
0
    public static Weapon GetRandomLaser()
    {
        Weapon p = new Weapon();

        p.sprite           = SpriteLoader.GetPartSprite("defaultWeaponS");
        p.Tier             = (Random.Range(1, 6));
        p.weaponType.Value = 0;
        p.Size             = PartSize.S;
        p.caliber.Value    = Random.Range(2, 20);
        p.turrets.Value    = Random.Range(0, 5);
        p.reload.Value     = Random.Range(2, 20);
        p.ModelName        = StringLoader.GetAString("weaponNames");
        Debug.Log(p.GetDescriptionString());
        Debug.Log(p.GetStatisticsString());
        return(p);
    }
Exemple #7
0
 public NPC()
 {
     species = GameDataManager.instance.Species[Random.Range(0, GameDataManager.instance.Species.Length)];
     gender  = species.genders[Random.Range(0, species.genders.Length)];
     if (gender == Gender.Male)
     {
         firstName = StringLoader.GetAString("FirstNamesMasculine");
     }
     else if (gender == Gender.Female)
     {
         firstName = StringLoader.GetAString("FirstNamesFeminine");
     }
     else
     {
         firstName = StringLoader.GetAString(new string[] { "FirstNamesFeminine", "FirstNamesMasculine" });
     }
     lastName = StringLoader.GetAString("LastNames");
 }
Exemple #8
0
    public static NPC GetChild(NPC parent)
    {
        Species species   = parent.species;
        Gender  gender    = species.genders[Random.Range(0, species.genders.Length)];
        string  firstName = "";

        if (gender == Gender.Male)
        {
            firstName = StringLoader.GetAString("FirstNamesMasculine");
        }
        else if (gender == Gender.Female)
        {
            firstName = StringLoader.GetAString("FirstNamesFeminine");
        }
        else
        {
            firstName = StringLoader.GetAString(new string[] { "FirstNamesFeminine", "FirstNamesMasculine" });
        }
        string lastName = parent.LastName;

        return(new NPC(species, gender, firstName, lastName));
    }