Spell Ice Trap

BRUTAL

I'm working
Reaction score
118
Ice Trap

Requires GTrigger, Key Timers 2; all included in the map.

Spell Description: Icicles pop out of the ground circling a targeted unit, and trapping everything inside. Any ground units trapped inside cannot get out, and no ground units can enter. This ability can be used to separate you from an army, and fight off a smaller number of enemy at a time. Deals damage per second to enemy ground units near the icicles.

Screen Shots:
icetrap1qz5.jpg


icetrap2wc7.jpg

Code:
JASS:
// Ice Trap by BRUTAL.
// Requires GT, and KT2.
// Credits are welcome but not necessary.
// October 12th 2009.

scope icetrap initializer init

globals
    private constant integer ID='A000' // ID of the ice trap spell.
    private constant integer IMMO_ID='A001' // ID of the ice immolation spell.
    private constant integer DUMMY_ID='h000' // ID of the ice trap unit.
    private constant integer PATH_BLOCK='YTpb' // ID of the path blocker that is created.
    private constant real PERIOD=.04 // Period of the KT2 timer.
    private constant real SCALE=1. // Scale size of ice trap unit.
    private constant integer ALPHA=75 // Percent transparency of ice trap unit.
    private constant integer MAX_UNITS=36 // Number of units that will circle around.
endglobals

private constant function DURATION takes integer level returns real
    return 6.+3.*level
endfunction

private constant function DISTANCE takes integer level returns real
    return 270.+ 20.*level
endfunction

private struct Data
    unit caster
    real x
    real y
    real angle
    integer pbInt=0
    integer ticks
    integer maxTicks
    destructable array pathBlock[MAX_UNITS]
    
    static method create takes unit u, real tx, real ty returns Data
        local Data data=Data.allocate()
        set data.caster=u
        set data.x=tx
        set data.y=ty
        set data.angle=GetUnitFacing(u)+140
        set data.ticks=R2I(DURATION(GetUnitAbilityLevel(data.caster,ID))/PERIOD)+10
        set data.maxTicks=data.ticks
        return data
    endmethod
    
    method circle takes nothing returns nothing
        local integer level=GetUnitAbilityLevel(.caster,ID)
        local real dis=DISTANCE(level)
        local real dur=DURATION(level)
        local real x=.x+dis*Cos(.angle*bj_DEGTORAD)
        local real y=.y+dis*Sin(.angle*bj_DEGTORAD)
        local unit u=CreateUnit(GetOwningPlayer(.caster),DUMMY_ID,x,y,bj_RADTODEG*Atan2(y-.y,x-.x))
        call SetUnitScale(u,SCALE,SCALE,SCALE)
        call SetUnitVertexColor(u,255,255,255,R2I(2.55*ALPHA))
        call UnitApplyTimedLife(u,'BTLF',dur)
        call UnitAddAbility(u,IMMO_ID)
        call SetUnitAbilityLevel(u,IMMO_ID,level)
        call IssueImmediateOrder(u,"immolation")
        set .angle=.angle+360./MAX_UNITS
        set .pathBlock[.pbInt]=CreateDestructable(PATH_BLOCK,x,y,0,1,0)
        set .pbInt=.pbInt+1
        set u=null
    endmethod
    
    method end takes nothing returns nothing
        local integer i=0
        loop
        exitwhen i==MAX_UNITS
            call KillDestructable(.pathBlock<i>)
            set i=i+1
        endloop
    endmethod
endstruct 

private function PeriodicFunc takes nothing returns boolean
    local Data data=KT_GetData()
    set data.ticks=data.ticks-1
    if data.ticks&lt;=0 then  
        call data.end()
        return true
    else
        if data.ticks&gt;=data.maxTicks-MAX_UNITS then
            call data.circle()
        endif
    return false
    endif  
endfunction 

private function actions takes nothing returns nothing
    call KT_Add(function PeriodicFunc,Data.create(GetTriggerUnit(),GetSpellTargetX(),GetSpellTargetY()),PERIOD)
endfunction

private function init takes nothing returns nothing
    call TriggerAddAction(GT_RegisterStartsEffectEvent(CreateTrigger(),ID),function actions)
endfunction

endscope</i>


Feedback is welcomed, if you see any bugs or mistakes let me know.
DL the map.
 

Attachments

  • Ice Trap gui.w3x
    51 KB · Views: 792
  • Ice Trap vJass.w3x
    54.4 KB · Views: 571
1

131ackout

Guest
OMG, THATS INTENSE!!!!

+rep :p

EDIT: Can't give the rep, have to spread first. :)
 

Kazuga

Let the game begin...
Reaction score
110
Didn't you make this for the spellcontest...? Cause I have seen this in the contest and I assume you made it?
Anyway it looks awsome.
 

Ghostwind

o________o
Reaction score
172
It looks pretty nice. Maybe to add it so that it makes the weather snow around the area when you use it =)
 

BRUTAL

I'm working
Reaction score
118
OMG, THATS INTENSE!!!!

+rep

EDIT: Can't give the rep, have to spread first.
thanks :p

Didn't you make this for the spellcontest...? Cause I have seen this in the contest and I assume you made it?
Anyway it looks awsome.
ya, i did note the
This is one of the spells that i submitted for the second Hero Contest. I just fixed it up the code, and made MUI.
that i put :p
thanks though

It looks pretty nice. Maybe to add it so that it makes the weather snow around the area when you use it =)
ty, i'll try that
 

BRUTAL

I'm working
Reaction score
118
okay, added the snow effects, and fixed the loading screen saying "wind tunnel" :p
 
1

131ackout

Guest
I don't see any snow effects in the screenshot.

I'm busy, don't have time to test the map.

:p
 

BRUTAL

I'm working
Reaction score
118
ya, i dont feel like adding new screenshots ><
just test it when you got time :p
 

Sim

Forum Administrator
Staff member
Reaction score
534
There's a little mess in the tooltip, has something to do with color codes. :p

The collision thing is messy. Sometimes the Ice Lord can pass through the wall, sometimes he cannot. Seriously though, remove that feature. Nobody can pass through ice, whether or not he created it. :p Adds a strategy feature too: don't trap yourself in!

This part of the code is causing it, most probably:

Code:
Five
    Events
        Time - Every 0.01 seconds of game time
    Conditions
        (Number of units in ItWalkUg) Greater than 0
    Actions
        Unit Group - Pick every unit in ItUg2 and do (Actions)
            Loop - Actions
                Set TempInt = (Custom value of (Picked unit))
                Set ItTriggUnitPos[TempInt] = (Position of ItTriggunit[TempInt])
                Set ItWalkPos[TempInt] = (Position of ItWalkThrough[TempInt])
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                (Distance between ItWalkPos[TempInt] and ItTriggUnitPos[TempInt]) Greater than (220.00 + ((Real((Level of Ice Trap  for ItCaster[TempInt]))) x 20.00))
                                (Distance between ItWalkPos[TempInt] and ItTriggUnitPos[TempInt]) Less than (340.00 + ((Real((Level of Ice Trap  for ItCaster[TempInt]))) x 20.00))
                    Then - Actions
                        Unit - Turn collision for ItCaster[TempInt] Off
                    Else - Actions
                        Unit - Turn collision for ItCaster[TempInt] On
        Custom script:   call RemoveLocation(udg_ItTriggUnitPos[udg_TempInt])
        Custom script:   call RemoveLocation(udg_ItWalkPos[udg_TempInt])

Apart from that, well done!
 

BRUTAL

I'm working
Reaction score
118
There's a little mess in the tooltip, has something to do with color codes.
o? i'll check it out

The collision thing is messy. Sometimes the Ice Lord can pass through the wall, sometimes he cannot. Seriously though, remove that feature. Nobody can pass through ice, whether or not he created it. Adds a strategy feature too: don't trap yourself in!
i know, i couldnt get it perfect . Originally that feature was not put in, i added it because someone suggested it and i thought it would be okay
i might as well take it out if i cant perfect it :p
thanks anyways
---------------------
Okay, uploaded a new file;
-fixed the tooltips
-fixed a levelskip problem
-removed the walk in/out part
-added new screenshots
 

BRUTAL

I'm working
Reaction score
118
i would, but its about the spells, not the hero :p
plus that would make the file size go up
 

Sim

Forum Administrator
Staff member
Reaction score
534
Merge your other (future) spells in (a) spellpack(s) please, but do not add this one. It will stay as a single submission.
 
B

Bonebuster

Guest
Healing

Maybe if u are traped in circle it heals u or something like that really cool spell :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top