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: 782
  • Ice Trap vJass.w3x
    54.4 KB · Views: 562
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.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1

      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