Jump to content
EleTD.com
Sign in to follow this  
Guest Timberwolf

Making towers with a day/night bonus

Recommended Posts

Guest Timberwolf

So, let's say I'm pretty bright, but I know nothing about JASS and am just working with the GUI interface. Let's say I have this tower I want to make, called an Energy Tower. Let's say I want it to have two upgrades, called Moon Tower and Sun Tower, the Sun tower is supposed to deal extra damage during the day, and the Moon tower extra damage at night.

How would one accomplish this day/night bonus? Assuming it's possible. I mean... Night elves have that "we can be invisible at night" thing, so I assume there has to be a way to set up effects based off time of day. I'm just not sure how.

Share this post


Link to post

I am not familiar with Jass myself and about only work with GUI.

I don't have wc3 at my dad and can't help you this weekend, sorry.

Share this post


Link to post
Guest emjlr3

there is an event for when the time of day reaches a certain point

6/18 would be day and night

you can then add/subtract/change however you want at that time

Share this post


Link to post
Guest Timberwolf

I think I have the code now, someone on another forum gave me a super quick and awesome answer for this. Thought I would share it because maybe someone else might find it handy.

There's two triggers (for daybreak and moonrise), and you need to make a custom damage skill where your extra damage comes from. Then you use Unit Group to effect all applicable units.

Events
    Time of Day becomes equal to 6.00
Conditions
Actions
    Custom script: set bj_wantDestroyGroup = true
    Unit Group - Pick every unit in (Units in (Playable Map Area) matching ((Unit-type of (Matching Unit)) equal to Sun Tower)) and do (Actions)
        Loop - Actions
            Unit - Add <YourDamageAbility> to (Picked Unit)
    Custom script: set bj_wantDestroyGroup = true
    Unit Group - Pick every unit in (Units in (Playable Map Area) matching ((Unit-type of (Matching Unit)) equal to Moon Tower)) and do (Actions)
        Loop - Actions
            Unit - Remove <YourDamageAbility> from (Picked Unit)



Events
    Time of Day becomes equal to 18.00
Conditions
Actions
    Custom script: set bj_wantDestroyGroup = true
    Unit Group - Pick every unit in (Units in (Playable Map Area) matching ((Unit-type of (Matching Unit)) equal to Moon Tower)) and do (Actions)
        Loop - Actions
            Unit - Add <YourDamageAbility> to (Picked Unit)
    Custom script: set bj_wantDestroyGroup = true
    Unit Group - Pick every unit in (Units in (Playable Map Area) matching ((Unit-type of (Matching Unit)) equal to Sun Tower)) and do (Actions)
        Loop - Actions
            Unit - Remove <YourDamageAbility> from (Picked Unit)

I haven't actually had time to sit down and write my own version of this into my map yet but I look at it and don't see any reason it shouldn't work perfectly.

Share this post


Link to post
Sign in to follow this  

×
×
  • Create New...