131 lines
7 KiB
Ruby
131 lines
7 KiB
Ruby
class Monster < Entity
|
|
@@monsterMods = [
|
|
"Crafty", "Stinky", "Spooky", "Surprisingly Stout", "Shockingly Petite",
|
|
"Malevolent", "Loud", "Nudist", "Rude", "Aroused", "Depressed",
|
|
"Seemingly Friendly but Violent", "Lazy", "Ugly", "Cute Lil'", "Impish", "Ancient",
|
|
"Ambiguously Gendered", "Idiotic", "Sticky", "Angery", "Dusty ol'", "Big",
|
|
"Mega", "Itty Bitty", "Vibrant Orange", "Yella-Bellied", "Cowardly", "Brave",
|
|
"Crusty", "Jankety", "Viral", "Blue-ish", "Moldy", "Musty", "Haunted", "Cursed",
|
|
"Buttery", "Sexy", "Drunken", "Foreign", "Extremely Sharp", "Shifty", "Smrat",
|
|
"Sharply Dressed", "Irate", "Psychic", "Emphatic", "Unreasonable",
|
|
"Dumb as Rocks", "Possessed", "High as Hell", "Annoying", "VERY LOUD",
|
|
"Oddly Erotic", "Confused", "Arrogant", "Undead", "Frustrated", "Transparent",
|
|
"Thicc", "Holy", "Unholy", "Filthy", "Slimy", "Contagious", "Fartin'", "Eccentric",
|
|
"Shartin'", "Eccentric", "Moist", "Ecstatic", "Zooming", "Grim (Up North)",
|
|
"Flatulent", "Nefarious", "Rotten", "Sacred", "Handsome", "Purdy", "Howling",
|
|
"Weeping", "Real Handsy", "Underachieving", "Playful", "Bubbly", "Offputting",
|
|
"Unnerving", "Mysterious", "Creeeepy", "Dirty", "Unfunny", "Inverted", "Inside-Out",
|
|
"Bleak", "Near-Sighted", "Uncooked", "Burnt", "Frosty", "Corpulent", "Winged",
|
|
"Mastermind", "Lackey", "Scientific", "Tenured", "Illegal", "[redacted]",
|
|
"Invisible", "Floating", "Oozing", "smol", "Embarrassing", "Cheeky", "Slanderous",
|
|
"Perverted", "Super-Fast", "Boring", "Educated", "Wary", "Ribbed", "Bumpy",
|
|
"Smooth", "Cheeked Up", "Insane", "Faaaaast", "Stoned", "Worthless", "Timid",
|
|
"Voyeuristic", "Watchful", "Crunchy", "Uncouth", "Brazen", "Regretful", "Practically Dead",
|
|
"Obviously Unhinged", "Volatile", "Problematic", "Wary", "Gifted", "Abstract",
|
|
"Disgusting", "Amateur", "Expired", "Fading", "Funky", "Bearded", "Feeble", "Frail",
|
|
"Crude", "Stringy", "El Fuego", "Paper Crown Wearing", "Majestic", "Beastly", "Number 7",
|
|
"Onanistic", "Stained", "Lucky", "Priapic", "Phallic", "Professional", "Wild", "Feral",
|
|
"Electric", "Droopy", "Dripping", "Questionable", "Wandering", "Scousey", "Troubled",
|
|
"Well-Adjusted", "Innocent", "Creepy", "Clown-Like", "Abrasive", "Arrogant", "1337",
|
|
"Tastefully Nude", "Wet", "All-Powerful", "Scandelous", "Remarkedly Stupid",
|
|
]
|
|
|
|
@@monsterTypes = [
|
|
"Goblin", "Orc", "Skeleton", "Skelly", "Bob", "Tim", "Witch", "Demon", "Cricket",
|
|
"Slime", "Ghost", "Gila Monster", "Sentient Paperclip", "Cthlululu", "Imp",
|
|
"BUG?!", "Influencer", "Duck", "Alium", "Hippie", "Druid", "Bean", "Woof", "Sheep",
|
|
"Opossum", "Dwarf", "Lizard Fella", "Sailor", "Spy", "Agent", "ChonKee", "Boar",
|
|
"Squirrel", "Hobo", "Hairball", "Wizard", "Pupper", "Doggo", "Cat", "Mother",
|
|
"Karen", "Magister", "Thief", "Leaky Glass", "Dead Battery", "Cow",
|
|
"Disembodied Foot", "Cloud", "Patch of Grass", "Ginger", "Warrior", "Bride",
|
|
"Badger", "Parrot", "Mummy", "Raider", "Knight", "Paladin", "Necromancer",
|
|
"Pixie", "Sprite", "Stranger", "College Student", "Child", "Foreigner", "Creep",
|
|
"Basement Dweller", "Pile of Clothes", "Box of Sand", "Lady", "Dude", "Nerd",
|
|
"Luggage", "Spooder", "Pirate", "Scientist", "Professor", "Monkey", "Tree", "Bus",
|
|
"[redacted]", "Moth", "Perv", "Sanic", "Wolverine", "Rock", "Eggplant", "Stoner",
|
|
"Honeybee", "Wasp", "Gnome", "Tunnel Dweller", "Truck", "Shrimp Appetizer Platter",
|
|
"Marine", "Pilot", "Faceless Beard", "Pork Slab", "Denizen", "Archer", "Weirdo Next Door",
|
|
"Can of Diet Sprite", "Ferret", "Guttersnipe", "Elf", "Horror", "Terror", "Wanderer",
|
|
"Person Who Works in the Cubicle Next to You", "Bunny Rabbit", "Hamster", "Degu",
|
|
"Metalhead", "Baking-Soda Volcano", "Canadian", "Moon", "Jazz Musician", "Robot",
|
|
"AI Program", "Flat Earther", "Entrepreneur", "Social Media Platform", "Man?", "Beast",
|
|
"American", "Brit", "Hippo", "7", "B-List Celebrity", "Bear", "Childs Drawing",
|
|
"Anime Character", "Merperson", "Salesperson", "Skellington", "Scallies", "Clown Puppet",
|
|
"Clown", "Puppet", "n00b", "Spider Shaped Man", "Bat Shaped Man", "Armadillo", "Unshucked Ear of Corn",
|
|
"Dustmite", "Single Follicle of Hair", "Optimal Pride",
|
|
]
|
|
|
|
@@encounter = [
|
|
"ran into", "encountered", "crossed paths with", "slammed into", "almost got stepped on by",
|
|
"crossed paths with", "almost got eaten by", "got into fisticuffs with", "failed to hide from",
|
|
"hunted down", "picked a fight with", "got caught sleeping by", "drunkenly bumped into",
|
|
"got bored and starting puching at", "attempted to poach", "tried to collect a trophy from",
|
|
"got jealous of and attacked", "got lost then found and got punchy with", "had beef to settle with",
|
|
"was inappropriately touched by", "had a misunderstanding with",
|
|
"was frustrated and confused by and started fighting",
|
|
]
|
|
|
|
@@getWin = [
|
|
"is brutally slaughtered", "straight up dies", "explodes into a million tiny pieces", "has been murdered",
|
|
"collapses into a pile of tears before slowly dying", "should probably be buried soon", "DESTROYED!!!",
|
|
"is beaten to a bloody pulp", "is permamently damaged", "wonders where things went so wrong and flees",
|
|
"dies from embarrassment", "ineffectively begs for forgiveness", "was exsanguinated",
|
|
]
|
|
|
|
@@getLoss = [
|
|
"mysteriously disappears", "vanishes in a puff of smoke", "spits at your feet and flips you the bird",
|
|
"returns to the dimension from whence they came", "saunters off happily", "gets bored of winning and leaves",
|
|
"somehow managed to not completely murder you", "runs away cackling", "is quite embarrassed for you",
|
|
"bows, then turns to walk away",
|
|
]
|
|
|
|
def get_default_doc()
|
|
return {
|
|
'type' => :monster,
|
|
'spawned_by' => nil,
|
|
'location' => nil,
|
|
'exp' => nil,
|
|
'line' => "",
|
|
'name' => @@monsterMods.sample + " " + @@monsterTypes.sample
|
|
}
|
|
end
|
|
|
|
def resolve(p)
|
|
max_xp_gain = self.get('exp')
|
|
max_player_strength = p.get('last_line').length
|
|
|
|
name = self.get("name")
|
|
|
|
article = "a"
|
|
|
|
if ['A','E','I','O','U', 'a','e','i','o','u'].include?(self.get('name')[0])
|
|
article = "an"
|
|
end
|
|
|
|
player_attack = 1+rand(max_player_strength)
|
|
foe_attack = 1+rand(self.get('exp'))
|
|
|
|
result = p.get('name') + "[" + max_player_strength.to_s + "str] "
|
|
|
|
result = result + @@encounter.sample + " " + article
|
|
|
|
result = result + " " + name
|
|
result = result + "[" + max_xp_gain.to_s + "str]" + "! "
|
|
result = result + "[" + player_attack.to_s + "dmg vs " + foe_attack.to_s + "dmg] "
|
|
|
|
if player_attack > foe_attack then
|
|
xp_gain = 1 + rand(max_xp_gain)
|
|
|
|
result = result + "The " + name + " " + @@getWin.sample + "! "
|
|
result = result + p.get("name") + " wins and earns " + xp_gain.to_s + "xp! "
|
|
|
|
p.gain_exp( xp_gain)
|
|
elsif player_attack < foe_attack then
|
|
result = result + "The " + self.get("name") + " wins and " + @@getLoss.sample + "! "
|
|
else
|
|
result = result + "They tied! They shake hands and agree to disagree. "
|
|
end
|
|
|
|
return result
|
|
end
|
|
end
|