Beispiel #1
0
        public static void HandleEndChallenge(string channel, string sender, string msg, IRC irc)
        {
            string  whostartedchall = Points.getChallenger(channel, sender);
            Channel channelinfo     = ModuleManager.channels.Find(x => x.Name == channel);

            if (!whostartedchall.Equals(""))
            {
                int r      = RandomN.getRandomUnsignedIntFromRange(0, 1);
                int points = Points.getChallPoints(channel, sender);
                if (r == 0)
                {
                    Points.removePoints(channel, sender, points);
                    Points.addPoints(channel, whostartedchall, points);
                    irc.SendChatMessage(channel, string.Format("{0} wygrywa pojedynek z {1} PogChamp i wygrywa {2} {3}", whostartedchall, sender, points, channelinfo.pointsConfig.pointsNameMultiple));
                    CancelChallenge(channel, sender);
                }
                else if (r == 1)
                {
                    Points.removePoints(channel, whostartedchall, points);
                    Points.addPoints(channel, sender, points);
                    irc.SendChatMessage(channel, string.Format("{0} wygrywa pojedynek z {1} PogChamp i wygrywa {2} {3}", sender, whostartedchall, points, channelinfo.pointsConfig.pointsNameMultiple));
                    CancelChallenge(channel, sender);
                }
            }
            else
            {
                //irc.SendChatMessage(channel, "Polecenie wpisane niepoprawnie.");
            }
        }
Beispiel #2
0
    void Start()
    {
        float size = RandomN.getRandomFloatByRange(startSizeRange);

        transform.localScale = new Vector3(size, size, 1.0f);
        speed = speedConstant * size;
    }
Beispiel #3
0
 void Update()
 {
     if (spawnCooldown.didCooldownExpire())
     {
         spawnCooldown.setCooldownAmount(RandomN.getRandomFloatByRange(spawnRate));
         spawn();
         spawnCooldown.startCooldown();
     }
 }
Beispiel #4
0
    // 3 4 3
    void Update()
    {
        if (timeLeft <= 0.0f)
        {
            roll = RandomN.getRandomFloatByRange(0, 100);

            float left = 10.0f;
            float stay = 80.0f;

            float right = 10.0f;


            if (last == -1)
            {
                left  = 35.0f;
                stay  = 60.0f;
                right = 5.0f;
            }
            else if (last == 1)
            {
                left  = 5.0f;
                stay  = 60.0f;
                right = 35.0f;
            }

            if (roll < left)
            {
                added = -RandomN.getRandomFloatByRange(moveAmountRange);
            }
            else if (roll < left + stay)
            {
                added = 0.0f;
            }
            else if (roll < left + stay + right)
            {
                added = RandomN.getRandomFloatByRange(moveAmountRange);
            }

            last     = added;
            timeLeft = totalTime;
        }
        else
        {
            timeLeft -= Time.deltaTime;
        }

        if (added != 0.0f)
        {
            Vector3 pos = transform.position;
            pos.x += added;
            transform.position = pos;
        }
    }
Beispiel #5
0
    void moveToStart()
    {
        if (transform.position.y > startY)
        {
            Vector3 movement = new Vector3(0, moveToStartSpeed, 0);

            movement *= Time.deltaTime;
            transform.Translate(movement);
        }
        else
        {
            hungryCooldown = RandomN.getRandomFloatByRange(hungryTimerRange);
        }
    }
Beispiel #6
0
    void Update()
    {
        if (spawnCooldown > 0)
        {
            spawnCooldown -= Time.deltaTime;
        }

        if (CanSpawn)
        {
            spawn();
            spawnCooldown = RandomN.getRandomFloatByRange(spawnRate) - (Time.timeSinceLevelLoad * spawnSpeedupConstant);
            Debug.Log(spawnCooldown);
            Debug.Log(Time.timeSinceLevelLoad * spawnSpeedupConstant);
        }
    }
Beispiel #7
0
    void Update()
    {
        if (spawnCooldown > 0)
        {
            spawnCooldown -= Time.deltaTime;
        }

        if (CanSpawn)
        {
            float x = RandomN.getRandomFloatByRange(-spawnXRange, spawnXRange);

            Transform newSprinkle = (Transform)Instantiate(spawneePrefab, new Vector3(x, spawnY, 0f), transform.rotation);
            newSprinkle.parent = transform;

            spawnCooldown = RandomN.getRandomFloatByRange(spawnNewPilesRateRange);
        }
    }
 void Update()
 {
     if (spawnLeftCooldown.didCooldownExpire() && (lastLeftSpawned == null || isTransformDistanceAway(lastLeftSpawned)))
     {
         float extraSpawnTime = spawn(true);
         //if (lastLeftSpawned != null)
         //	Debug.Log ("spawning left" + Mathf.Abs (lastLeftSpawned.position.y - transform.position.y));
         spawnLeftCooldown.setCooldownAmount(RandomN.getRandomFloatByRange(spawnRate) + extraSpawnTime);
         spawnLeftCooldown.startCooldown();
     }
     if (spawnRightCooldown.didCooldownExpire() && (lastRightSpawned == null || isTransformDistanceAway(lastRightSpawned)))
     {
         float extraSpawnTime = spawn(false);
         //Debug.Log ("spawning right");
         spawnRightCooldown.setCooldownAmount(RandomN.getRandomFloatByRange(spawnRate) + extraSpawnTime);
         spawnRightCooldown.startCooldown();
     }
 }
    void Update()
    {
        if (spawnCooldown > 0)
        {
            spawnCooldown -= Time.deltaTime;
        }

        if (CanSpawn)
        {
            spawn();
            spawnCooldown = RandomN.getRandomFloatByRange(spawnRate);

            if (scaleWithLevelSpeed)
            {
                Debug.Log(spawneePrefab.name + " " + spawnCooldown + " " + levelSpeed.NonPlayerSpeedRatio + " = " + (spawnCooldown / levelSpeed.NonPlayerSpeedRatio));
                spawnCooldown /= levelSpeed.NonPlayerSpeedRatio;
            }
        }
    }
Beispiel #10
0
        public static void Roulette(string channel, string name, int points, IRC irc)
        {
            Channel channelinfo = ModuleManager.channels.Find(x => x.Name == channel);

            if (points > Points.getPoints(channel, name))
            {
                irc.SendChatMessage(channel, string.Format("{0} ma za mało {1}", name, channelinfo.pointsConfig.pointsNameMultiple));
                return;
            }
            int r = RandomN.getRandomUnsignedIntFromRange(0, 1);

            if (r == 0)
            {
                // user von
                irc.SendChatMessage(channel, string.Format("{0} wygrywa {1} {2} PogChamp", name, points, channelinfo.pointsConfig.pointsNameMultiple));
                Points.addPoints(channel, name, points);
            }
            else if (r == 1)
            {
                // user lost
                irc.SendChatMessage(channel, string.Format("{0} przegrywa i traci {1} {2} FeelsBadMan", name, points, channelinfo.pointsConfig.pointsNameMultiple));
                Points.removePoints(channel, name, points);
            }
        }
Beispiel #11
0
 void Start()
 {
     spawnCooldown = new Cooldown(RandomN.getRandomFloatByRange(spawnRate));
     spawnCooldown.startCooldown();
 }
Beispiel #12
0
 void Start()
 {
     spawnCooldown = RandomN.getRandomFloatByRange(spawnNewPilesRateRange);
 }
Beispiel #13
0
    private void spawn()
    {
        float x = RandomN.getRandomFloatByRange(-spawnXRange, spawnXRange);

        TransformFactory.make2dTransform(spawneePrefab, new Vector2(x, spawnY), transform);
    }