Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.76 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using StardewModdingAPI;
  7. using StardewModdingAPI.Events;
  8. using StardewValley;
  9. using StardewValley.Monsters;
  10. using Microsoft.Xna.Framework;
  11.  
  12. namespace SMAPITrailMod
  13. {
  14.     class TrailMod : Mod
  15.     {
  16.         TrailConfig config;
  17.         public override void Entry(IModHelper helper)
  18.         {
  19.             GameEvents.SecondUpdateTick += this.trail;
  20.             config = helper.ReadConfig<TrailConfig>();
  21.         }
  22.  
  23.         public void trail(object sender, EventArgs e)
  24.         {
  25.             Farmer f = Game1.player;
  26.             Monster monster = null;
  27.             if (config.trailType.ToLower() == "blood")
  28.             {
  29.                 monster = new Duggy(f.position);
  30.             }
  31.             else if (config.trailType.ToLower() == "slime")
  32.             {
  33.                 monster = new GreenSlime(f.position);
  34.             }
  35.             else if (config.trailType.ToLower() == "1")
  36.             {
  37.                 monster = new Bat(f.position);
  38.             }
  39.             else if (config.trailType.ToLower() == "2")
  40.             {
  41.                 monster = new Bug(f.position, 1);
  42.             }
  43.             else if (config.trailType.ToLower() == "3")
  44.             {
  45.                 monster = new DustSpirit(f.position);
  46.             }
  47.             else if (config.trailType.ToLower() == "4")
  48.             {
  49.                 monster = new Fireball(f.position);
  50.             }
  51.             Game1.currentLocation.characters.Add(monster);
  52.             monster.deathAnimation();
  53.             Game1.currentLocation.characters.Remove(monster);
  54.         }
  55.     }
  56.  
  57.     class TrailConfig
  58.     {
  59.         public string trailType { get; set; } = "blood";
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement