Preventing or redirecting damage?
Post MTG Forge Related Programming Questions Here
	Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
			3 posts
			 • Page 1 of 1
		
	
Preventing or redirecting damage?
 by gofishus » 10 Oct 2010, 16:21
by gofishus » 10 Oct 2010, 16:21 
Is there anybody currently working on keywording prevent or redirect X damage to target creature or player? Or knows a nice way to do it? This would make it easy for cards like Hallowed Healer to be implemented quite nicely. I noticed that cards like Healing Salve, Shunt and Redirect weren't there yet so I'm curious. (or perhaps it's the choose clause that explains the lack of charms and commands, although Funeral Charm is there already)
			
		- gofishus
- Posts: 34
- Joined: 09 Oct 2010, 04:57
- Has thanked: 0 time
- Been thanked: 0 time
Re: Preventing or redirecting damage?
 by friarsol » 10 Oct 2010, 16:31
by friarsol » 10 Oct 2010, 16:31 
I don't think anyone is working on them. I had considered previously what was the best way but it's pretty far down on my list of things to do. I would think it would be similar to how Regeneration bubbles work. 
You activate it on a creature/player. Add the amount of preventable to a variable. In the deal damage function, reduce the amount of damage dealt by the amount preventable (maximum of amount of damage). Subtract that amount from the preventable variable too. If the amount of damage is now 0, return out of the function. Otherwise, continue as normal with the new reduced damage amount. During cleanup, set the variable to 0 just like for Regeneration bubbles.
It's basically the same as a Regeneration bubble except it changes the how damage is assigned, instead of how destruction is handled.
			
		You activate it on a creature/player. Add the amount of preventable to a variable. In the deal damage function, reduce the amount of damage dealt by the amount preventable (maximum of amount of damage). Subtract that amount from the preventable variable too. If the amount of damage is now 0, return out of the function. Otherwise, continue as normal with the new reduced damage amount. During cleanup, set the variable to 0 just like for Regeneration bubbles.
It's basically the same as a Regeneration bubble except it changes the how damage is assigned, instead of how destruction is handled.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Preventing or redirecting damage?
 by Rob Cashwalker » 10 Oct 2010, 19:49
by Rob Cashwalker » 10 Oct 2010, 19:49 
We have Fog though, so there is at least some framework to begin from.
Redirecting damage would be more difficult.
Healing Salve, and other "choose one" spells are a separate issue of enabling the two choices for the AI to pick the better option. Especially considering the AI can't play it during combat.
			Redirecting damage would be more difficult.
Healing Salve, and other "choose one" spells are a separate issue of enabling the two choices for the AI to pick the better option. Especially considering the AI can't play it during combat.
The Force will be with you, Always.
		- 
				 
 Rob Cashwalker
- Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
			3 posts
			 • Page 1 of 1
		
	
Who is online
Users browsing this forum: No registered users and 26 guests
