Monster resistance list

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Monster resistance list

Post by minmay »

There are 5 resistance levels for monsters in Grimrock 2 other than the default (nothing) so I ran some trials (i.e. 100000 damageTile calls each) to figure out the exact numbers for them:
"absorb" - Heals for 1x the damage
"immune" - Takes 0 damage (duh)
"resist" - Takes 0.5x damage
"weak" - Takes 1.5x damage
"vulnerable" - Takes 2.0x damage

That is all.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Monster resistance list

Post by akroma222 »

I wanted to share - a Poison Cloud that will reduce a monster's level of resistance to poison

Seems like the place to post this up.... (I think some of this script was originally yours minmay)

The Poison Cloud definition:
SpoilerShow

Code: Select all

defineObject{
	name = "poison_cloud_limeburst",
	baseObject = "base_spell",
	components = {
		{
			class = "Particle",
			particleSystem = "poison_cloud_limeburst",
			offset = vec(0, 0.2, 0),
		},
		{
			class = "Light",
			offset = vec(0, 0.2, 0),
			color = vec(0.5, 0.8, 0.25),
			brightness = 8,
			range = 5,
			fadeOut = 13,
			disableSelf = true,
		},
		{ 
			class = "Script",
			name = "data",
			source = [[
				data = {}
				function get(self,name) 
					return self.data[name] 
				end
				function set(self,name,value) 
					self.data[name] = value 
				end
			]],      
		},
		{
			class = "TileDamager",
			attackPower = 10,
			damageType = "pure",
			repeatCount = 3,
			repeatDelay = 1,
			sound = "poison_cloud",
			screenEffect = "poison_bolt_screen",
			damageFlags = DamageFlags.Impact,
			castByChampion = 1,
			onHitMonster = function(self, monster)
				-------------------------------------------------------------
				local levels = {"absorb", "immune", "resist", "weak", "vulnerable"}
				local resists = {}
				local resP = monster:getResistance("poison")
				for k,v in pairs(levels) do
					local newRef = k + 1
					local newLvl = levels[newRef]
					resists = {poison = newLvl}
					-----------------------------------------
					if not resP then
						resists = {poison = "weak"}
						return customBrainScripts.script.changeResistances(monster, resists, "Poison: Weak", "FF0000")
					elseif resP == v then
						if v == "weak" then 
							return customBrainScripts.script.changeResistances(monster, resists, "Poison: Vulnerable", "FF0000")
						elseif v == "vulnerable" then 
							return customBrainScripts.script.changeResistances(monster, resists)
						else
							return customBrainScripts.script.changeResistances(monster, resists, "Poison: Resist Down", "FF0F00")
						end
					end
				end
			end,
			onHitChampion = function(self, champion)
				local math = math.random()
				if not champion:hasTrait("poison_resistant") then
					if math < 0.1 then
						champion:upgradeBaseStat("resist_poison", -2)
						hudPrint(champion:getName().." Loses 2 points of Poison Resistance...")
					elseif math < 0.4 then
						champion:upgradeBaseStat("resist_poison", -1)
						hudPrint(champion:getName().." Loses 1 point of Poison Resistance...")
					end
				end	
			end,
		},	
		{
			class = "CloudSpell",
			attackPower = 7.5,
			damageInterval = 1.5,
			damageType = "poison",
			duration = 3,
			sound = "evil_bubble_01",
			castByChampion = 1,
		},
	},
}
If you want the particle effect I use here (no custom textures) then:
SpoilerShow

Code: Select all

defineParticleSystem{
   name = "poison_cloud_limeburst",
   emitters = {
      	{
         	spawnBurst = true,
         	maxParticles = 300,
         	spawnBurst = false,
        	boxMin = {-0.5, -0.4,-0.5},
		boxMax = { 0.5,  0.2, 0.5},
         	sprayAngle = {0,360},
         	velocity = {0.0,0.0},
         	objectSpace = true,
         	texture = "assets/textures/particles/smoke_01.tga",
         	lifetime = {3,3},
         	colorAnimation = false,
         	color0 = {0.15, 1.5, 0.1},
         	opacity = 0.2,
         	fadeIn = 0.5,
         	fadeOut = 1.5,
         	size = {0.1, 0.22},
         	gravity = {0,0.3,0},
         	airResistance = 10,
         	rotationSpeed = 0.2,
         	blendMode = "Additive",
      },
	-- pollen
		{
			spawnBurst = true,
			maxParticles = 1000,
			boxMin = {-1,-1.3,-1},
			boxMax = { 1, 0.8, 1},
			sprayAngle = {0,30},
			velocity = {0.5,1.0},
			objectSpace = true,
			texture = "assets/textures/particles/smoke_01.tga",
			lifetime = {1,2},
			color0 = {1.5,1.5,0.5},
			opacity = 0.15,
			fadeIn = 0.1,
			fadeOut = 0.3,
			size = {0.03, 0.05},
			gravity = {0,-1.2,0},
			airResistance = 0.1,
			rotationSpeed = 2,
			blendMode = "Additive",
		},
		
		{
			spawnBurst = true,
			maxParticles = 200,
			boxMin = {-0.5, -0.4,-0.5},
			boxMax = { 0.5,  0.2, 0.5},
			sprayAngle = {0,360},
			velocity = {0.1,0.7},
			objectSpace = true,
			texture = "assets/textures/particles/poison_cloud.tga",
			lifetime = {2.5,2.5},
			color0 = {0.5, 0.9, 0.5},
			opacity = 0.4,
			fadeIn = 0.5,
        		 fadeOut = 1.5,
			size = {0.1, 0.25},
			gravity = {0,0.3,0},
			airResistance = 0.1,
			rotationSpeed = 0.5,
			blendMode = "Additive",
		},

		-- fog
		{
			spawnBurst = true,
			maxParticles = 300,
			boxMin = {-1.2, -1.0,-1.2},
			boxMax = { 1.2,  0.5, 1.2},
			sprayAngle = {0,360},
			velocity = {0.1,0.7},
			objectSpace = true,
			texture = "assets/textures/particles/glow.tga",
			lifetime = {2,3},
			color0 = {0.20, 0.50, 0.14},
			opacity = 0.5,
			fadeIn = 0.5,
         		fadeOut = 1.5,
			size = {0.4, 0.75},
			gravity = {0,0.3,0},
			airResistance = 0.1,
			rotationSpeed = 0.1,
			blendMode = "Additive",
		}
	}
}
It calls a function 'changeResistances(monster, newResistances, text, colour)'
........ in a script entity 'customBrainScripts'
SpoilerShow

Code: Select all

function changeResistances(monster, newResistances, text, colour)
    local damageTypes = {"fire","cold","shock","poison","physical","dispel"}
    local resists = {}
    for r,b in ipairs(damageTypes) do
		resists[b] = newResistances[b] or monster:getResistance(b)
    end
	if text and colour then
		monster:showDamageText(text, colour)
	end
    monster:setResistances(resists)
end

Also... here are some DamageText colour examples
---------monster:showDamageText("......text.......", "FFFF00")
SpoilerShow

Code: Select all

  
--"00FF00" GREEN
--"000F00" Dark GREEN
--"FFFF00" YELLOW
--"FF0000" RED
--"F00000" Bright RED
--"0F0000" Dark RED
--"0000FF" BLUE
--"0F0F0F" DARK GREY
--"FFFFFF" WHITE
--"F0F0F0" WHITE
--"000000" BLACK
Post Reply