Beispiel #1
0
    public Vill(VillagerActivePlayer player, EntityArea entityArea) : base(entityArea)
    {
        this.player = player;

        attackCooldown = RXRandom.Float();         //random cooldown to start so they're not synced

        offsetY = 6f;

        int numArts = 8;

        artIndex = RXRandom.Range(0, numArts) + 1;

        body       = new FContainer();
        bodySprite = new FSprite("Arena/Vill" + artIndex + "_body");
        body.AddChild(bodySprite);

        colorSprite       = new FSprite("Arena/Vill" + artIndex + "_color");
        colorSprite.color = player.player.color.color;
        body.AddChild(colorSprite);

        weapon = new FContainer();
        body.AddChild(weapon);

        string weaponName = RXRandom.GetRandomString("RollingPin", "Torch", "Pitchfork", "", "", "", "");   //Rake, FryingPan

        if (weaponName != "" && artIndex != 8)
        {
            if (weaponName == "Torch")
            {
                var torch = new VillTorch();
                weapon.AddChild(torch);
            }
            else
            {
                FSprite weaponSprite = new FSprite("Arena/" + weaponName + "_1");
                weapon.AddChild(weaponSprite);
            }
        }


        shadowSprite        = new FSprite("Arena/VillShadow");
        shadowSprite.alpha  = 0.2f;
        shadowSprite.scaleX = 0.7f;
        shadowSprite.scaleY = 0.5f;

        hopper = new Hopper(this);
        hopper.config.jumpDist     = RXRandom.Range(18f, 19f);
        hopper.config.jumpDuration = RXRandom.Range(0.2f, 0.24f);
        hopper.config.jumpHeight   = RXRandom.Range(3f, 4f);
    }
Beispiel #2
0
 public static void NightStart()
 {
     manager.PlaySound(RXRandom.GetRandomString("Arena/growl0", "Arena/growl1", "Arena/growl2", "Arena/growl3"), 1.0f);
 }
Beispiel #3
0
 public static void DayStart()
 {
     manager.PlaySound(RXRandom.GetRandomString("Arena/laugh1", "Arena/laugh2"), 1.0f);
 }
Beispiel #4
0
 public static void VillDeath()
 {
     manager.PlaySound(RXRandom.GetRandomString("Arena/hit05", "Arena/hit06", "Arena/hit07", "Arena/hit08"), 0.5f);
 }
Beispiel #5
0
 public static void WolfDeath()
 {
     manager.PlaySound(RXRandom.GetRandomString("Arena/growl0", "Arena/growl1", "Arena/growl2", "Arena/growl3"), 1.0f);
 }
Beispiel #6
0
 public static void VillAttack()
 {
     manager.PlaySound(RXRandom.GetRandomString("Arena/hit01", "Arena/hit02", "Arena/hit03", "Arena/hit04"), 1.0f);
 }
Beispiel #7
0
 public static void WolfAttack()
 {
     manager.PlaySound(RXRandom.GetRandomString("Arena/bite0", "Arena/bite1", "Arena/bite2", "Arena/bite3"), 1.0f);
 }