New, 'flexible' Explosion Expert

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
Zonk
Sher'Tul
Posts: 1067
Joined: Sat Mar 01, 2003 4:01 pm

New, 'flexible' Explosion Expert

#1 Post by Zonk »

There's an issue with Explosion Expert.

Buying it can actually be to your disadvantage, because as a passive, it ALWAYS makes your bomb explosion larger, even when you don't really want too.

Yes, Alchemist Protection now also applies to your golem, but thisis still not as good as, you know, NOT hurting yourself and your golem at all. Not to mention escorts and other potential allies.

Making it a sustain would be an improvement, but it's still all-or-nothing. If you have 5 points in this, you'd be forced to choose between the base radius of 1, and a radius of 6.
A bit extreme...and silly - if you are an expert, why can't you choose to control the radius of your blasts by making it 'appropriately' large?

So I coded something different: let the player pick how much extra radius they want, without adding extra talents, prompting for a number, or complicated stuff like that.

Basically:

Explosion Expert becomes an activated talent that takes no time(no_energy) and has no cost.
Using it cycles between available bomb radiuses, from 1(what you start with) to 6.

So you buy the talent, you use it once - your bomb radius is now 2. Use it again - radius is now 1.
If you buy it again, you have 2 levels and cano gup to radius 3, and so on.

Would also be nice to show the current bomb range on the screen/left panel - but it's not REALLY needed as you can check the Throw Bomb talent info or just use Throw Bomb and see the radius(and escape/change it if you're not ok with it).


Here's the code: check for any errors, tweak as appropriate, maybe rewrite the Explosion Expert talent info and then replace what we have now in explosives.lua :D

Code: Select all


newTalent{
	name = "Throw Bomb",
	type = {"spell/explosives", 1},
	require = spells_req1,
	points = 5,
	mana = 5,
	cooldown = 4,
	range = function(self, t)
		return math.ceil(5 + self:getDex(12))
	end,
	direct_hit = true,
	requires_target = true,
	computeDamage = function(self, t, ammo)
		local inc_dam = 0
		local damtype = DamageType.FIRE
		local particle = "ball_fire"
		if self:isTalentActive(self.T_ACID_INFUSION) then inc_dam = self:getTalentLevel(self.T_ACID_INFUSION) * 0.05; damtype = DamageType.ACID_BLIND; particle = "ball_acid"
		elseif self:isTalentActive(self.T_LIGHTNING_INFUSION) then inc_dam = self:getTalentLevel(self.T_LIGHTNING_INFUSION) * 0.05; damtype = DamageType.LIGHTNING_DAZE; particle = "ball_lightning"
		elseif self:isTalentActive(self.T_FROST_INFUSION) then inc_dam = self:getTalentLevel(self.T_FROST_INFUSION) * 0.05; damtype = DamageType.ICE; particle = "ball_ice"
		else inc_dam = self:getTalentLevel(self.T_FIRE_INFUSION) * 0.07 + (ammo.alchemist_bomb.power or 0) / 100; damtype = self:knowTalent(self.T_FIRE_INFUSION) and DamageType.FIREBURN or DamageType.FIRE
		end
		local dam = self:combatTalentSpellDamage(t, 15, 150, (ammo.alchemist_power + self:combatSpellpower()) / 2)
		dam = dam * (1 + inc_dam)
		return dam, damtype, particle
	end,
	action = function(self, t)
		local ammo = self:hasAlchemistWeapon()
		if not ammo then
			game.logPlayer(self, "You need to ready alchemist gems in your quiver.")
			return
		end

		local tg = {type="ball", range=self:getTalentRange(t)+(ammo.alchemist_bomb.range or 0 ), radius=1+(self.extra_bomb_radius or 0), talent=t}
		local x, y = self:getTarget(tg)
		if not x or not y then return nil end

		ammo = self:removeObject(self:getInven("QUIVER"), 1)
		if not ammo then return end

		local dam, damtype, particle = t.computeDamage(self, t, ammo)
		local prot = self:getTalentLevelRaw(self.T_ALCHEMIST_PROTECTION) * 0.2
		local golem
		if self.alchemy_golem then
			golem = game.level:hasEntity(self.alchemy_golem) and self.alchemy_golem or nil
		end
		local dam_done = 0

		local tmp = {}
		local grids = self:project(tg, x, y, function(tx, ty)
			local d = dam
			-- Protect yourself
			if tx == self.x and ty == self.y then d = dam * (1 - prot) end
			-- Protect the golem
			if golem and tx == golem.x and ty == golem.y then d = dam * (1 - prot) end
			if d == 0 then return end

			dam_done = dam_done + DamageType:get(damtype).projector(self, tx, ty, damtype, self:spellCrit(d), tmp)
			local target = game.level.map(tx, ty, Map.ACTOR)
			if not target then return end
			if ammo.alchemist_bomb.splash then
				DamageType:get(DamageType[ammo.alchemist_bomb.splash.type]).projector(self, tx, ty, DamageType[ammo.alchemist_bomb.splash.type], ammo.alchemist_bomb.splash.dam)
			end
			if ammo.alchemist_bomb.stun and rng.percent(ammo.alchemist_bomb.stun.chance) and target:checkHit(self:combatSpellpower(), target:combatPhysicalResist(), 0, 95, 5) and target:canBe("stun") then
				target:setEffect(target.EFF_STUNNED, ammo.alchemist_bomb.stun.dur, {})
			end
			if ammo.alchemist_bomb.daze and rng.percent(ammo.alchemist_bomb.daze.chance) and target:checkHit(self:combatSpellpower(), target:combatPhysicalResist(), 0, 95, 5) and target:canBe("stun") then
				target:setEffect(target.EFF_DAZED, ammo.alchemist_bomb.daze.dur, {})
			end
		end)

		if ammo.alchemist_bomb.leech then self:heal(math.min(self.max_life * ammo.alchemist_bomb.leech / 100, dam_done)) end

		local _ _, x, y = self:canProject(tg, x, y)
		-- Lightning ball gets a special treatment to make it look neat
		if particle == "ball_lightning" then
			local sradius = (tg.radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
			local nb_forks = 16
			local angle_diff = 360 / nb_forks
			for i = 0, nb_forks - 1 do
				local a = math.rad(rng.range(0+i*angle_diff,angle_diff+i*angle_diff))
				local tx = x + math.floor(math.cos(a) * tg.radius)
				local ty = y + math.floor(math.sin(a) * tg.radius)
				game.level.map:particleEmitter(x, y, tg.radius, "lightning", {radius=tg.radius, grids=grids, tx=tx-x, ty=ty-y, nb_particles=25, life=8})
			end
		else
			game.level.map:particleEmitter(x, y, tg.radius, particle, {radius=tg.radius, grids=grids, tx=x, ty=y})
		end

		if ammo.alchemist_bomb.mana then self:incMana(ammo.alchemist_bomb.mana) end

		game:playSoundNear(self, "talents/arcane")
		return true
	end,
	info = function(self, t)
		local ammo = self:hasAlchemistWeapon()
		local dam, damtype = 1, DamageType.FIRE
		if ammo then dam, damtype = t.computeDamage(self, t, ammo) end
		dam = damDesc(self, damtype, dam)
		return ([[Imbue an alchemist gem with an explosive charge of mana and throw it.
		The gem will explode(radius %d) for %0.2f %s damage.
		Each kind of gem will also provide a specific effect.
		The damage will improve with better gems and Magic stat and the range with your dexterity.]]):format(1+(self.extra_bomb_radius or 0),dam, DamageType:get(damtype).name)
	end,
}

newTalent{
	name = "Explosion Expert",
	type = {"spell/explosives", 2},
	require = spells_req2,
	no_energy = "true",
	points = 5,
	action = function(self, t)
		local max = self:getTalentLevelRaw(t)
		local xtra = self.extra_bomb_radius	or 0
		xtra = xtra +1
		if xtra > max then xtra = 0 end
		self.extra_bomb_radius = xtra
		game.logPlayer(self, "Bomb radius is now %d.", xtra+1)
		return true
	end,
	info = function(self, t)
		return ([[You can increase the radius of your alchemist bombs by up to %d. 
			Activate this talent to cycle through available radiuses.]]):format(self:getTalentLevelRaw(t))
	end,
}
ToME online profile: http://te4.org/users/zonk
Addons (most likely obsolete): Wights, Trolls, Starting prodigy, Alternate save/resistance system

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: New, 'flexible' Explosion Expert

#2 Post by yufra »

I like the idea. Another option would be to have each level of explosion expert give access to a different throw bomb talent with varying radius, but that could cluttered.
<DarkGod> lets say it's intended

Zonk
Sher'Tul
Posts: 1067
Joined: Sat Mar 01, 2003 4:01 pm

Re: New, 'flexible' Explosion Expert

#3 Post by Zonk »

yufra wrote:I like the idea. Another option would be to have each level of explosion expert give access to a different throw bomb talent with varying radius, but that could cluttered.
That's one of the ideas I considered too, but I dismissed it as cluttery.
Another idea was to have 2 new activated talents that increase/decrease radius and can be used more than once(one would be +1 radius, the other -1)...but I think my idea in the OP is just better, even if it requires a few extra keypresses;)
ToME online profile: http://te4.org/users/zonk
Addons (most likely obsolete): Wights, Trolls, Starting prodigy, Alternate save/resistance system

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: New, 'flexible' Explosion Expert

#4 Post by Hachem_Muche »

As an alchemist player, I really like this idea. I usually delay getting more than a point or two in this talent until after I've done most of the escort quests because it's so hard to use around friendlies.

How hard would it be to code the throw bomb command so that it responds to the '+' and '-' keys during the targeting phase?

The way this would go is:

Player hit's the throw bomb command.
The log shows: "PlayerName activates throw bomb. Use +/- to change radius."
The player uses the mouse/direction keys to target the center of the explosion, and the +/- keys to change it's radius with the targetting cloud adjusting in size as he does so.
When the player hits enter, the spell is cast and the radius selected is saved for the next time the spell is cast.
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

Elkan
Archmage
Posts: 336
Joined: Wed Aug 08, 2007 12:23 pm

Re: New, 'flexible' Explosion Expert

#5 Post by Elkan »

I don't know how easy or hard this would be to code but how about a 2 stage targeting process, similar to how a high level teleport or phase door works.

You cast the spell, and select a target for the epicentre of the blast. Then you get a second targeting prompt on the same spot as the target. You then get to move the cursor again to pick how far out the blast goes. Move one square to the left, and you get a blast that extends one point to the cardinal directions, move the cursor up and left from the centre, you get a 1 radius circle, move the cursor two to the left you get a 2 radius circle move it diagonally twice and you get a 2 radius square. So that basically you pick the blast centre then move the cursor to the edge of where you want the blast to hit, and it tries to match a radius to that location and no further up to the maximum radius your skill allows for. By default if left on the target it should default to maximum range.

Lailoken
Higher
Posts: 76
Joined: Wed May 19, 2010 4:11 pm

Re: New, 'flexible' Explosion Expert

#6 Post by Lailoken »

The thing I don't like about that, is that then it takes twice as long to throw every bomb, even if you have maxed out alch protection and there are no escortees in sight. I know people are encouraged to play these games slow and deliberate, but I like having the option to speed on through if I am strong enough.

Elkan
Archmage
Posts: 336
Joined: Wed Aug 08, 2007 12:23 pm

Re: New, 'flexible' Explosion Expert

#7 Post by Elkan »

Lailoken wrote:The thing I don't like about that, is that then it takes twice as long to throw every bomb, even if you have maxed out alch protection and there are no escortees in sight. I know people are encouraged to play these games slow and deliberate, but I like having the option to speed on through if I am strong enough.
In which case you simply double tap enter or double click as it defaults to max range centred on your target, it only takes aprecciably longer if you need to alter it from the biggest blast

Zonk
Sher'Tul
Posts: 1067
Joined: Sat Mar 01, 2003 4:01 pm

Re: New, 'flexible' Explosion Expert

#8 Post by Zonk »

Hachem_Muche wrote:How hard would it be to code the throw bomb command so that it responds to the '+' and '-' keys during the targeting phase?

The way this would go is:

Player hit's the throw bomb command.
The log shows: "PlayerName activates throw bomb. Use +/- to change radius."
The player uses the mouse/direction keys to target the center of the explosion, and the +/- keys to change it's radius with the targetting cloud adjusting in size as he does so.
When the player hits enter, the spell is cast and the radius selected is saved for the next time the spell is cast.
That would be MUCH more player-friendly than what I coded, although it would take some more work..it might as well be applied to all talents with a variable radius(in which case we'd need a min and max radius field)

However, DarkGod said(in chat) that he doesn't feel this kind of radius-changing option is necessary, so I wouldn't hope too much.
ToME online profile: http://te4.org/users/zonk
Addons (most likely obsolete): Wights, Trolls, Starting prodigy, Alternate save/resistance system

Reverend Bizarre
Higher
Posts: 61
Joined: Sun Jul 11, 2010 9:03 am

Re: New, 'flexible' Explosion Expert

#9 Post by Reverend Bizarre »

I approve of this idea. In fact, the lack of flexibility of the Explosion Expert talent is the only thing that stops me from playing for the Alchemist, though it's an interesting class. :\

escargot
Thalore
Posts: 128
Joined: Thu Oct 14, 2010 2:55 pm

Re: New, 'flexible' Explosion Expert

#10 Post by escargot »

Pardon me, but I kinda like the two-edged nature of Explosion expert.
For the most part of early game I was just fine with 1 point in it, and I was able to deal with the bomb throwing just fine, I believe there's almost always a way to deal with the explosion radius to get it on your favor (and if not, is just like having an escort on your side and wanting to cast Death Dance). In my opinion it really adds to the fact you throw bombs. Getting your Protection up and running is a must, since the moment you get it to 5 points and you start raising your Explosion Expert you are pretty welcome to bomb-mayhem, and it feels like it, like you really learnt new and more powerful skills.

I prefer it as something you have to deal with, until you are strong enough it won't matter. Besides, from dealing with the blast radius of your bombs you actually learn how to exploit it's AoE; well, at least I did.

I understand I could just ignore the +/- function if available, but I consider it part of the learning curve of being an alchemist: dealing with your explosions.

Something that could be considered is gems with a fixed blast radius. So, if you are in the maze, you'll probably want to get the smallest blast radius if you have not yet upped your Protection completely. This could be to the extent that each tier of alchemist gems had it's own blast radius and the skill could be thrashed entirely; but I'm not sure if this is the way to go.

Zonk
Sher'Tul
Posts: 1067
Joined: Sat Mar 01, 2003 4:01 pm

Re: New, 'flexible' Explosion Expert

#11 Post by Zonk »

escargot wrote: In my opinion it really adds to the fact you throw bombs. Getting your Protection up and running is a must, since the moment you get it to 5 points and you start raising your Explosion Expert you are pretty welcome to bomb-mayhem, and it feels like it, like you really learnt new and more powerful skills.
[...]
I understand I could just ignore the +/- function if available, but I consider it part of the learning curve of being an alchemist: dealing with your explosions.
I think that's a pretty bad argument.
Yes, you're throwing bombs...so?
How does learning to make bombs with a larger blast radius make you unable to use smaller ones if there's need to?
How does the blast radius being bigger even when you don't want it to make you feel like you learnt something, even if you and the golem end up immune to the effects?
Escorts and other potential allies won't be(and I'm not suggesting they should be/get the benefits of Protection)

If you're really an Explosion Expert, you should be able to make small, focused explosions when you feel there's the need to.
That, I think, would make it feel like you've learned something, as you get more versatility, not just a 'bigger boom'.

Your Death Dance comparison is just weird. That's an activated talent which always has the same radius.

Here's an example which I feel is more relevant: Imagine if Berserkers had a Passive talent that had a chance of turning other attacks into Death Dances, or just to give bonus attacks against random adjacent NPCs.
Or if it made Death Dance affect non-adjacent foes...so if there's a monster between you and an escort, using Death Dance would hurt it.

That would be a better example..and even then, I could *sorta* justify it as the Berserker growing so savage they sometimes lash out at nearby allies - especially if it only worked while the Berserker sustain was on.


I can see this kind of 'drawback' problem working well/adding to the game for stuff like a Wild/Chaos mage, who might actually have LESS control as they grow in power...But not Alchemists(or even 'normal' mages, for which I feel the +/- radius idea would work very well too. Shame it just won't be implemented.).
ToME online profile: http://te4.org/users/zonk
Addons (most likely obsolete): Wights, Trolls, Starting prodigy, Alternate save/resistance system

escargot
Thalore
Posts: 128
Joined: Thu Oct 14, 2010 2:55 pm

Re: New, 'flexible' Explosion Expert

#12 Post by escargot »

Yeh, you are right. I understand. But I've always seen bombs as something incontrolable, like in Bomberman (or Achmed:P), where more power meant more risk for the thrower. I know the analogy isn't the appropriate, but I see bombs like that.

Well, I'm sorry I can't really defend my position with a stronger argument, I just happen to like how bombs work... I feel them like bombs, and not like an AoE mage spell.

Vee
Thalore
Posts: 127
Joined: Tue Nov 02, 2010 10:27 pm

Re: New, 'flexible' Explosion Expert

#13 Post by Vee »

... of course the smaller bomb would not only mean smaller explosion radius, but also smaller damage to the targets. Basically holding back the talent (i.e. player has Explosion Expert at level 5, but holds back 3 levels, so the thrown bomb works as if he only had level 2.)
greycat wrote:An intervention was required (kill -9)

Zonk
Sher'Tul
Posts: 1067
Joined: Sat Mar 01, 2003 4:01 pm

Re: New, 'flexible' Explosion Expert

#14 Post by Zonk »

Vee wrote:... of course the smaller bomb would not only mean smaller explosion radius, but also smaller damage to the targets. Basically holding back the talent (i.e. player has Explosion Expert at level 5, but holds back 3 levels, so the thrown bomb works as if he only had level 2.)
What if I have Throw Bomb at 5 and Explosion Expert at 0? I can throw 1-radius bombs just fine...Then, when I learn Explosion Expert and 'hold back' to radius 1, my bombs are weaker?
That's a problem.



However, your idea does have some merit...I'd do it differently though: Explosion Expert could also provide a damage bonus(say +5% per level, maybe +10% but that might be execssive), and giving up the extra radius would also mean giving up that +damage effect.

This could be tactically interesting: you need to do more damage to a foe, but increasing the radius would also mean hurting an ally...Yeah, I like it.
ToME online profile: http://te4.org/users/zonk
Addons (most likely obsolete): Wights, Trolls, Starting prodigy, Alternate save/resistance system

Post Reply