Ejemplo n.º 1
0
    private void Start()
    {
        turncount    = 0;
        pm           = gameObject.GetComponent <PointManager>();
        namegen      = gameObject.GetComponent <Lexic.NameGenerator>();
        debugfood    = resources.food;
        debugoranges = resources.oranges;
        debugwater   = resources.water;
        debugbooze   = resources.booze;
        debuggold    = resources.gold;
        for (int i = 0; i < 10; i++)
        {
            pirate p = new pirate();
            p.maxphp = 100f;
            p.maxmhp = 100f;

            p.mhp  = p.maxmhp;
            p.php  = p.maxphp;
            p.name = namegen.GetNextRandomName();

            if (i < 5)
            {
                p.prof = Class.Sailor;
            }
            else
            {
                p.prof = Class.Fighter;
            }

            pirates.Add(p);
        }
    }
    void Initialize()
    {
        currentID  = 0;
        homeworlds = int.Parse(starData[2]) + 1;

        starmap         = new GameObject("Starmap").transform;
        homeworldParent = new GameObject("Homeworlds").transform;

        starColorToGameObject = new SortedDictionary <StarColor, GameObject>();
        starColorToGameObject.Add(StarColor.YELLOW, stars[0]);
        starColorToGameObject.Add(StarColor.RED, stars[1]);
        starColorToGameObject.Add(StarColor.GREEN, stars[2]);
        starColorToGameObject.Add(StarColor.BLUE, stars[3]);
        starColorToGameObject.Add(StarColor.PURPLE, stars[4]);
        starColorToGameObject.Add(StarColor.WHITE, stars[5]);

        maxStarPositions = new Vector2(0.0f, 0.0f);
        minStarPositions = new Vector2(float.MaxValue, float.MaxValue);

        // Generate and setup star weights.
        setupStarWeights();

        InitializeLists();

        // Set source class for name generation.
        namegen = GameObject.Find("NameGen").GetComponent <Lexic.NameGenerator>();
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        txt     = GetComponent <Text>();
        namegen = nameGenObject.GetComponent <Lexic.NameGenerator>();
        string newtext = "";

        for (int i = 0; i < 10; i++)
        {
            newtext += "\n" + namegen.GetNextRandomName();
        }
        txt.text = newtext;
    }
Ejemplo n.º 4
0
    private void Start()
    {
        //test
        //UnityEngine.Random r = new UnityEngine.Random();
        //UnityEngine.Random.InitState(System.DateTime.Now.Millisecond);
        //for (int i = 0; i < 100; i++)
        //{
        //    Debug.Log(UnityEngine.Random.Range(0, 100));
        //}

        turncount = 0;
        MaxHull   = 100;
        HullPoint = MaxHull;
        pm        = gameObject.GetComponent <PointManager>();
        namegen   = gameObject.GetComponent <Lexic.NameGenerator>();

        /*debugfood=resources.food;
        *  debugoranges=resources.oranges;
        *  debugwater=resources.water;
        *  debugbooze=resources.booze;
        *  debuggold=resources.gold;*/
        for (int i = 0; i < 10; i++)
        {
            pirate p = new pirate();
            p.vc     = 50;
            p.maxphp = 100f;
            p.maxmhp = 100f;

            p.mhp = p.maxmhp;
            p.php = p.maxphp;

            p.name = namegen.GetNextRandomName();

            if (i < 5)
            {
                p.prof = Class.Sailor;
            }
            else
            {
                p.prof = Class.Fighter;
            }

            pirates.Add(p);
        }
    }
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     namegen = GetComponent <Lexic.NameGenerator> ();
 }