Extend beams caused by Arcane Combat

All new ideas for the upcoming releases of ToME 4.x.x should be discussed here

Moderator: Moderator

Post Reply
Message
Author
yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Extend beams caused by Arcane Combat

#1 Post by yufra »

Grey and I were talking about Arcane Blades and he suggested having the beam spells (Flame at lvl 5, Lightning at all levels) extend past the first target until they met a friendly target (don't want to kill those escorts!) or a wall. I have updated the arcane combat section in Combat.lua below and tested it. What do you think?

EDIT: I have been playing with this and it is a lot of fun to see a flame beam fly across the map. :D

Code: Select all

	-- Autospell cast
	if hitted and not target.dead and self:knowTalent(self.T_ARCANE_COMBAT) and self:isTalentActive(self.T_ARCANE_COMBAT) and rng.percent(20 + self:getTalentLevel(self.T_ARCANE_COMBAT) * (1 + self:getDex(9, true))) then
		local spells = {}
		if self:knowTalent(self.T_FLAME) then spells[#spells+1] = self.T_FLAME end
		if self:knowTalent(self.T_LIGHTNING) then spells[#spells+1] = self.T_LIGHTNING end
		local tid = rng.table(spells)
		if tid then
			-- Extending beam target, assumes a maximum range of 20
			local current_angle = math.atan2((target.y - self.y), (target.x - self.x)) + math.pi
			target_x = self.x - math.floor(0.5 + (20 * math.cos(current_angle)))
			target_y = self.y - math.floor(0.5 + (20 * math.sin(current_angle)))
			local l = line.new(self.x, self.y, target_x, target_y)
			local lx, ly = l()
			target_x, target_y = lx, ly
			-- Check for terrain and friendly actors
			while lx and ly do
				local actor = game.level.map(lx, ly, engine.Map.ACTOR)
				if actor and (self:reactionToward(actor) >= 0) then
					break
				elseif game.level.map:checkEntity(lx, ly, engine.Map.TERRAIN, "block_move") then
					target_x, target_y = lx, ly
					break
				end
				target_x, target_y = lx, ly
				lx, ly = l()
			end
			print("[ARCANE COMBAT] autocast ",self:getTalentFromId(tid).name)
			local old_cd = self:isTalentCoolingDown(self:getTalentFromId(tid))
			self:forceUseTalent(tid, {ignore_energy=true, force_target={x=target_x, y=target_y, __no_self=true}})
			-- Do not setup a cooldown
			if not old_cd then
				self.talents_cd[tid] = nil
			end
			self.changed = true
		end
	end
<DarkGod> lets say it's intended

Final Master
Sher'Tul
Posts: 1022
Joined: Fri May 21, 2010 8:16 pm
Location: Inside the minds of all
Contact:

Re: Extend beams caused by Arcane Combat

#2 Post by Final Master »

Sounds good to me.
Final Master's Character Guides
Final Master's Guide to the Arena
Edge: Final Master... official Tome 4 (thread) necromancer.
Zonk: I'd rather be sick than on fire! :D

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Extend beams caused by Arcane Combat

#3 Post by Grey »

I hope this is implemented - looks like fun without being game-breaking.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

edge2054
Retired Ninja
Posts: 3756
Joined: Fri May 28, 2010 4:38 pm

Re: Extend beams caused by Arcane Combat

#4 Post by edge2054 »

Grey wrote:I hope this is implemented - looks like fun without being game-breaking.
Arcane Blade's could probably stand for a power boost anyhow.

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Extend beams caused by Arcane Combat

#5 Post by darkgod »

done
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply