HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Shrapnade

03-18-2008, 02:18 AM#1
Rising_Dusk
Zoom (requires log in)
Shrapnade
v1.07

Description

Spell Description:
Shrapnade
Range: 1000
Cooldown: 3 seconds

Lobs an explosive bomb towards the target point which explodes and fragments into multiple other bombs upon landing. Each bomb deals damage.

Level 1 - 80 damage per bomb, 1 fragment
Level 2 - 100 damage per bomb, 2 fragments
Level 3 - 120 damage per bomb, 3 fragments
Level 4 - 140 damage per bomb, 4 fragments
Level 5 - 160 damage per bomb, 5 fragments


Background:
The spell is made specifically for the Spell Session #10 on wc3c. The spell also complies with the JESP manifest, is fully multi-instanceable, and requires Grimoire and vJass.
Change Log

v1.0: Spell created and submitted for critique.
v1.04: Spell updated to fix some errors and make more things modular.
v1.05: Corrected some typos in the documentation.
v1.06: Corrected some style concerns.
v1.07: Made the timer correctly pause.


Spell Code:
Expand Spell Code:

Special Thanks:
All credits to anything used in the spell are in the testmap, but I'll do it again here. There's really not much to say, thanks to Vex for vJass and JESP and his dummy model. Thanks to wc3c for another cool contest. Thanks to everyone who participated in the contest for being awesome. Thanks to whoever took the time to test and play with my spell...

And thank you WC3C for being the coolest WC3 site evar. <3
Attached Images
File type: jpgShrapnade.jpg (83.2 KB)
Attached Files
File type: w3xSpellSession10_Shrapnade_v1.07.w3x (73.4 KB)
03-19-2008, 01:28 AM#2
moyack
Ok, some comments:
  • In the onCreate method of the struct nade, you should put this: local nade n = nade.allocate()
  • (optional) you use a filter function, which is constant, and you create it and destroy in every callback. You can store that boolexpr as a private global var and call it directly instead of creating and destroying it all the time.

What else... no, no more...

Fix this and I'll move it where it belongs.
03-19-2008, 01:35 AM#3
Rising_Dusk
Quote:
In the onCreate method of the struct nade, you should put this: local nade n = nade.allocate()
They do the exact same thing though, I was reading how it works the same way in the jass helper manual when making it. If I had named the method "create" it would require .allocate, but since I named it "onCreate" I can use .create
Quote:
You can store that boolexpr as a private global var and call it directly instead of creating and destroying it all the time.
Didn't we establish in the other topic that there's no memory allocation difference? :p If you'd really like me to fix the nominal style concerns I will, but I don't personally think it needs them. You're the mod, you tell me!

Oh, and I deleted your double post.
03-19-2008, 03:02 AM#4
moyack
Quote:
Originally Posted by Rising_Dusk
They do the exact same thing though, I was reading how it works the same way in the jass helper manual when making it. If I had named the method "create" it would require .allocate, but since I named it "onCreate" I can use .create
well, yes, they do the same, but (if I understood properly what the create and allocate functions do) allocate() is the most direct function to set the struct index (AKA like using the native). I've just checked, and Jasshelper replaces internally .create() with .allocate() automatically, so in this case no worries.

Quote:
Didn't we establish in the other topic that there's no memory allocation difference? :p If you'd really like me to fix the nominal style concerns I will, but I don't personally think it needs them. You're the mod, you tell me!
Don't forget this part: (optional), if you like to destroy boolexpr every time you make a loop, then I won't interfere, as it was said, it's so minimal the effect that there's no problem, so you can left as is.

I've tested with several heroes and such to ensure the MUI (no problems...), so... don't give to this baby more await.

*approved*

EDIT: I fixed my double post :P

EDIT2: I forgot to say that I'm glad you've learned vJASS, keep the good work.
03-19-2008, 02:55 PM#5
Rising_Dusk
Quote:
EDIT2: I forgot to say that I'm glad you've learned vJASS, keep the good work.
Yeah, I'm glad I did too, made this spell loads easier to code. <3
03-19-2008, 10:31 PM#6
Here-b-Trollz
Collapse JASS:
function InitTrig_Shrapnade takes nothing returns nothing
    set gg_trg_Shrapnade = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Shrapnade, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Shrapnade, Condition(function Conditions))
    call TriggerAddAction(gg_trg_Shrapnade, function Actions)
endfunction

Not to be picky, but for the sake of the user, who may already have a spell named Shrapnade, would this not be more appropriate?

Collapse JASS:
public function InitTrig takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t, Condition(function Conditions))
    call TriggerAddAction(t, function Actions)
endfunction

Then, changing the name of the spell is as easy as changing the scope name. If you really were hellbent on having the global, then something like:

Collapse JASS:
globals
    public trigger Trig
endglobals

public function InitTrig takes nothing returns nothing
    set Trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(Trig, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(Trig, Condition(function Conditions))
    call TriggerAddAction(Trig, function Actions)
endfunction

But really, that's a long way to go... And it's just a suggestion.
03-19-2008, 10:50 PM#7
Rising_Dusk
I agree with you, but I know from personal experience that I always like to have that global trigger handy for use as necessary. I think it may be wiser to do it your way, though, for the sake of full copy/pasta of the spell across the map.

I'll update momentarily.
EDIT: Updated.
06-06-2008, 04:09 AM#9
Leopard
I love this spell and quite nice terrain, keep up your good job ^^