| 02-18-2009, 09:17 PM | #1 | |
Ok people, this is the return of my infamous Light Shield. After a discussion with Rising_Dusk complaining about me not using systems and doing things in an insane way, I quited the spell again, after all it worked well. However, recently (once again) I started working on the spell to make it approved, I decided that after so much time wasted on the spell, it would be a crime not to make an acceptable version of it to wc3c. Therefore I returned from the shadows making this spell as modular as I can, with as much experience as possible for a newbie like me xD I know the mods are having problems with the unstoppable waves of submissions (or so I have been told) and I also know that the server was down for a few days, so instead of blasting the spell right in the submitting section (as I usually do when I finish) I decided to be more helpful and to post it on the Triggers and Scripts section of wc3c and THW so I could get critics on the code and suggestions for ideas and improvements. Anyway, I think I did all I could to ease the job of the moderators, and somehow, I think I am addicted to the high standards of wc3c (it's a curse, trust me...) so here i am presenting another spell for the community. Description: - A JESP spell that allows the hero to cast a shield on a not Ud ally or on an Ud enemy (just like Holy Light). The shield will absorb an amount of damage for the allied unit thus protecting it from harm, or it will amplify the damage caused to the unit if it is enemy. When the shield dies, the shield unit will get healed by the remaining energies of the shield if it is an ally, or it will be damage by the remaining energies if it is an enemy. Requirements: - Jass NewGen Pack (uses vJASS) - Timer Utils ( I use Blue flavor) - xe basic and xedamage module - ABuff and ADamage - LastOrder(stand alone version) and AbortSpell History:
code: LightShield 2.1.3.txt I am sorry, but I can not post the entire code here... it is too long, so instead I just post a txt file with it. |
| 02-19-2009, 06:16 AM | #2 | |
Quote:
|
| 02-19-2009, 12:46 PM | #3 |
i was under the impression Dusks lastorder doodad was built to work through the issueorder event, though perhaps it makes no difference JASS:call SetWidgetLife(shieldData.shielded, damage * 0.9) i say save the multiplication and just use 1., or .5 - how often does someone actually take damage that is less then 1.? and how often does it actually matter? the overhead is negligable, but neglibable is the name of the game here - also I wonder, what if damage*.9<.405? ( I haven't run the math with your expression but it seems possible) also, won't that method screw with assistance systems? - I see no internal way you can pass out who did the life reduction...currently |
| 02-19-2009, 12:58 PM | #4 | ||
Quote:
Quote:
About armor, the extra damage is calculated based on the incoming damage, which is reduced by armor, so the extra damage will depend on the armor afaik. And it will not screw assistance systems, first because the extra damage will be caused by the attacking unit and second because it can't die due extra damage, it dies due to the final damage. In case my english skills fail, I just want to say that I am 100% this will not mess up assistance systems because we always have the attacker doing the damage in last place, thus the attacking unit always gets credit. |
| 02-19-2009, 02:29 PM | #5 | |
Quote:
|
| 02-19-2009, 03:39 PM | #6 |
FP, looks like you commented on a pre-edited version of my post, look at it again |
| 02-19-2009, 03:52 PM | #7 | |||
Quote:
Quote:
Besides I am really not sure if it is my obligation to make my spells compatible with all other systems out there, because that is impossible. Quote:
|
| 02-19-2009, 04:30 PM | #8 |
It could still be better using the same library. If you read the AbortSpell library documentation, it works best on the ISSUED_ORDER events. It still works on the SPELL_CAST event, but it's a quick change and improves the order intercepting significantly. If you're doing it in that launch spell with SPELL_CAST, I recommend changing it there as well. |
| 02-19-2009, 04:51 PM | #9 | |
Quote:
|
| 02-19-2009, 05:52 PM | #10 |
along with spells, etc. maybe I am entirely blind, but when exactly do you use the method damaged? |
| 02-19-2009, 06:31 PM | #11 | |
Quote:
F_P, you should only list the spell's actual requirements. For example, you don't use TimerUtils or Table, ABuff uses them; a different implementation of ABuff might not need them. Also, you really should be using the order event for aborting spells. |
| 02-19-2009, 08:08 PM | #12 | |||
Quote:
Mmm, it seems a quick change in fact I will change that asap. Quote:
Besides, how am I supposed to do that with the method Moyack suggested ? I just can't. For some reason amplifying damage with ADamage is nearly impossible, it is a nightmare to avoid an infinite loop, and xedamage doesn't help at all. Quote:
Ok guys, I will make a few changes and then will update this post telling what I changed. EDIT EDIT EDIT Ok guys, I made a few updates, see changelog (or code) for more info. Meh, heck with it: 1 - I changed the event to issue order (as requested by Dusk) 2 - simplified the SETUP section and therefore the inner code related to it 3 - fixed a few typos 4 - fixed a bug (or so I think it was one) 5 - Removed Table and TimerUtils from the requirements (as requested by Ani) I think this is all =P |
| 03-09-2009, 02:47 AM | #13 | |
Quote:
Your spell now conflicts with any other spell using the same orderstring, fix it. |
| 03-09-2009, 11:39 AM | #14 | |||
Quote:
Quote:
EDIT EDIT EDIT Version Updated to meet (some of) Anitarf's demands: - Now the shield considers armor - Added TimerUtils to requirements because now I use it on code directly Please see change log for more info. Ani, I still need your help to understand what you want me to change about he conflicting order. Quote:
|
| 03-09-2009, 12:43 PM | #15 |
if another hero uses a spell with with the same order string, al biet of a different ability, this will consider it the same thing that should not be the case |
