Skip to content

Commit e9fa477

Browse files
Added item "Resonating Maul"
1 parent 886fced commit e9fa477

File tree

11 files changed

+262
-89
lines changed

11 files changed

+262
-89
lines changed

Logo.xcf

221 KB
Binary file not shown.
5.09 KB
Binary file not shown.
Binary file not shown.

wurst/Abilities/CurseMasterShop/CorruptedTouch.wurst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public class CorruptedTouch
4343
..tooltipStopListen()
4444
curseMasterShopDef.addAbilitySold(ID, true, ICON, NAME, tooltipGen.getTooltipLearnExtended(), SHOP_COST)
4545
new AbilityDefinitionAlchemistAcidBomb(DUMMY_ABIL_ID)
46-
..setDummyAbility()
4746
..setMissileArt("")
4847
..setMissileSpeed(0)
4948
..setLevels(LEVELS)
@@ -56,6 +55,7 @@ public class CorruptedTouch
5655
..presetAreaofEffect((lvl) -> 0)
5756
..presetDamageInterval((lvl) -> 1000)
5857
..presetTargetsAllowed((lvl) -> TARGETS_ALLOWED)
58+
..setDummyAbility()
5959
new BuffDefinition(BUFF_ID, 'Basl')
6060
..setName(1, NAME)
6161
..setIcon(ICON)

wurst/Abilities/EarthServantShop/QuakeStomp.wurst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ public class QuakeStomp
7575
..setTooltipNormal(1, NAME)
7676
..setTooltipNormalExtended(1, BUFF_DESC)
7777
new AbilityDefinitionFarseerEarthquake(DUMMY_ABIL_ID)
78-
..setDummyAbility()
7978
..setLevels(LEVELS)
8079
..presetAreaofEffect((int lvl) -> AOE[lvl - 1])
8180
..presetFinalArea((int lvl) -> AOE[lvl - 1])
8281
..presetDamageperSecondtoBuildings((int lvl) -> 0)
8382
..presetTargetsAllowed((int lvl) -> TARGETS_ALLOWED)
8483
..presetBuffs((int lvl) -> BUFF_ID.toRawCode())
84+
..setDummyAbility()
8585

8686
protected static function onInit()
8787
preloadAbility(DUMMY_ABIL_ID)

wurst/Abilities/GnomeShop/StormHammer.wurst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Preloader
1818

1919

2020

21-
class StormHammer
21+
public class StormHammer
2222
static constant SHOP_COST = 1
2323
static constant LEVELS = 5
2424
static constant HOTKEY = getHotkey()
@@ -96,7 +96,16 @@ class StormHammer
9696
..presetCastingTime((int lvl) -> 0)
9797
gnomeShopDef.addAbilitySold(ABIL_ID, false, ICON, NAME, tooltipGen.getTooltipLearnExtended(), SHOP_COST)
9898

99+
// Specifically for Resonating Maul
99100
use LinkedListModule
101+
private unit caster
102+
private vec2 pos
103+
104+
function getCaster() returns unit
105+
return caster
106+
107+
function getPos() returns vec2
108+
return pos
100109

101110
private static function isValidTarget(unit caster, unit u) returns bool
102111
return u.isEnemyOf(caster) and u.isAlive() and not u.isType(UNIT_TYPE_MAGIC_IMMUNE) and not u.isInvulnerable()
@@ -117,7 +126,11 @@ class StormHammer
117126
let callAmount = (dist2d / PROJECTILE_SPEED / ANIMATION_PERIOD).toInt()
118127
var _currCall = 0
119128

129+
this.caster = caster
130+
pos = launchPos.toVec2()
131+
120132
doPeriodicallyCounted(ANIMATION_PERIOD, callAmount) (projCb) ->
133+
pos = proj.getPos()
121134
if not projCb.isLast()
122135
proj.setPos(launchPos.bezier3(control, target, _currCall/callAmount))
123136
_currCall += 1
@@ -140,6 +153,7 @@ class StormHammer
140153
..destr()
141154
enumGroup.destr()
142155
enumUnmarked.destr()
156+
destroy this
143157
else
144158
enumGroup.clear()
145159
enumUnmarked.clear()

wurst/Abilities/GnomeShop/ThunderClap.wurst

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,59 @@ import GnomeShop
99
import HotkeyFactory
1010

1111

12-
constant SHOP_COST = 1
13-
constant LEVELS = 5
14-
constant HOTKEY = getHotkey()
15-
constant ICON = Icons.bTNThunderClap
16-
constant NAME = "Thunder Clap"
17-
constant DESCRIPTION = "Slams the ground, dealing damage to nearby enemy units and slowing their movement and attack rate."
18-
constant BUFF_DESCRIPTION = "This unit has been hit by Thunder Clap; its movement speed and attack rate are reduced."
12+
public class ThunderClap
13+
static constant SHOP_COST = 1
14+
static constant LEVELS = 5
15+
static constant HOTKEY = getHotkey()
16+
static constant ICON = Icons.bTNThunderClap
17+
static constant NAME = "Thunder Clap"
18+
static constant DESCRIPTION = "Slams the ground, dealing damage to nearby enemy units and slowing their movement and attack rate."
19+
static constant BUFF_DESCRIPTION = "This unit has been hit by Thunder Clap; its movement speed and attack rate are reduced."
1920

20-
constant TARGETS_ALLOWED = "air,ground,organic,enemy"
21-
constant AOE = 300.
22-
constant DURATION = 2.
23-
constant COOLDOWN = 5.
24-
constant MOVEMENT_SPEED_REDUCTION = 0.5
25-
constant ATTACK_SPEED_REDUCTION = 0.5
26-
constant MANACOST = [85, 90, 95, 100, 105]
27-
constant DAMAGE = [50., 65., 85., 110., 135.]
21+
static constant TARGETS_ALLOWED = "air,ground,organic,enemy"
22+
static constant AOE = 300.
23+
static constant DURATION = 2.
24+
static constant COOLDOWN = 5.
25+
static constant MOVEMENT_SPEED_REDUCTION = 0.5
26+
static constant ATTACK_SPEED_REDUCTION = 0.5
27+
static constant MANACOST = [85, 90, 95, 100, 105]
28+
static constant DAMAGE = [50., 65., 85., 110., 135.]
2829

29-
constant ABIL_ID = compiletime(ABIL_ID_GEN.next())
30-
constant BUFF_ID = compiletime(BUFF_ID_GEN.next())
30+
static constant FX_EFFECT = Abilities.thunderclapCaster
3131

32+
static constant ID = compiletime(ABIL_ID_GEN.next())
33+
static constant BUFF_ID = compiletime(BUFF_ID_GEN.next())
3234

33-
@compiletime function build()
34-
let tooltipGen = new AbilityTooltipGenerator(NAME, DESCRIPTION)
35-
new AbilityDefinitionMountainKingThunderClap(ABIL_ID)
36-
..setIconNormal(ICON)
37-
..setName(NAME)
38-
..presetHotkey(HOTKEY)
39-
..setHeroAbility(true)
40-
..setRequirements("")
41-
..setRace(Race.Human)
42-
..registerTooltipGenerator(tooltipGen)
43-
..tooltipStartListen()
44-
..setLevels(LEVELS)
45-
..addTooltipProperty("Damage", (int lvl) -> DAMAGE[lvl - 1].toInt())
46-
..addTooltipProperty("Attack Rate Reduction", (int lvl) -> (ATTACK_SPEED_REDUCTION * 100).toInt().toString() + "%")
47-
..addTooltipProperty("Movement Speed Reduction", (int lvl) -> (MOVEMENT_SPEED_REDUCTION * 100).toInt().toString() + "%")
48-
..presetAreaofEffect((int lvl) -> AOE)
49-
..presetDurationNormal((int lvl) -> DURATION)
50-
..presetCooldown((int lvl) -> COOLDOWN)
51-
..presetManaCost((int lvl) -> MANACOST[lvl - 1])
52-
..tooltipStopListen()
53-
..presetDurationHero((int lvl) -> DURATION)
54-
..presetAOEDamage((int lvl) -> DAMAGE[lvl - 1])
55-
..presetTargetsAllowed((int lvl) -> TARGETS_ALLOWED)
56-
..presetBuffs((int lvl) -> BUFF_ID.toRawCode())
57-
gnomeShopDef.addAbilitySold(ABIL_ID, false, ICON, NAME, tooltipGen.getTooltipLearnExtended(), SHOP_COST)
58-
new BuffDefinition(BUFF_ID, 'Basl')
59-
..setIcon(ICON)
60-
..setName(1, NAME)
61-
..setTooltipNormal(1, NAME)
62-
..setTooltipNormalExtended(1, BUFF_DESCRIPTION)
35+
@compiletime
36+
private static function build()
37+
let tooltipGen = new AbilityTooltipGenerator(NAME, DESCRIPTION)
38+
new AbilityDefinitionMountainKingThunderClap(ID)
39+
..setIconNormal(ICON)
40+
..setName(NAME)
41+
..setArtCaster("")
42+
..setArtEffect(FX_EFFECT)
43+
..presetHotkey(HOTKEY)
44+
..setHeroAbility(true)
45+
..setRequirements("")
46+
..setRace(Race.Human)
47+
..registerTooltipGenerator(tooltipGen)
48+
..tooltipStartListen()
49+
..setLevels(LEVELS)
50+
..addTooltipProperty("Damage", (int lvl) -> DAMAGE[lvl - 1].toInt())
51+
..addTooltipProperty("Attack Rate Reduction", (int lvl) -> (ATTACK_SPEED_REDUCTION * 100).toInt().toString() + "%")
52+
..addTooltipProperty("Movement Speed Reduction", (int lvl) -> (MOVEMENT_SPEED_REDUCTION * 100).toInt().toString() + "%")
53+
..presetAreaofEffect((int lvl) -> AOE)
54+
..presetDurationNormal((int lvl) -> DURATION)
55+
..presetCooldown((int lvl) -> COOLDOWN)
56+
..presetManaCost((int lvl) -> MANACOST[lvl - 1])
57+
..tooltipStopListen()
58+
..presetDurationHero((int lvl) -> DURATION)
59+
..presetAOEDamage((int lvl) -> DAMAGE[lvl - 1])
60+
..presetTargetsAllowed((int lvl) -> TARGETS_ALLOWED)
61+
..presetBuffs((int lvl) -> BUFF_ID.toRawCode())
62+
gnomeShopDef.addAbilitySold(ID, false, ICON, NAME, tooltipGen.getTooltipLearnExtended(), SHOP_COST)
63+
new BuffDefinition(BUFF_ID, 'Basl')
64+
..setIcon(ICON)
65+
..setName(1, NAME)
66+
..setTooltipNormal(1, NAME)
67+
..setTooltipNormalExtended(1, BUFF_DESCRIPTION)

wurst/Abilities/NatureServantShop/EntanglingRoots.wurst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ constant DUMMY_BUFF_ID = compiletime(BUFF_ID_GEN.next())
6666
..presetCastingTime((int lvl) -> 0)
6767
natureServantShopDef.addAbilitySold(ABIL_ID, false, ICON, NAME, tooltipGen.getTooltipLearnExtended(), SHOP_COST)
6868
new AbilityDefinitionEnsnare(DUMMY_ABIL_ID)
69-
..setDummyAbility()
7069
..setBuffs(1, "{0},{1}".format(DUMMY_BUFF_ID.toRawCode(), DUMMY_BUFF_ID.toRawCode()))
7170
..setDurationNormal(1, 99999)
7271
..setDurationHero(1, 99999)
7372
..setAirUnitLowerDuration(1, 0)
7473
..setMissileSpeed(0)
7574
..setMissileArt("")
7675
..setAirUnitLowerDuration(1, 0.3)
76+
..setDummyAbility()
7777
new BuffDefinition(DUMMY_BUFF_ID, 'Basl')
7878
..setIcon(ICON)
7979
..setName(1, NAME)
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
package ResonatingMaul
2+
import Assets
3+
import ItemObjEditing
4+
import ChannelAbilityPreset
5+
6+
import ItemTooltipGenerator
7+
import ItemAbilityPreset
8+
import ItemAlias
9+
import DalaranMerchant
10+
import SobiMask
11+
import Mindstaff
12+
import BlacksmithHammer
13+
14+
import StormHammer
15+
import ThunderClap
16+
import ItemCombine
17+
import LinkedList
18+
import ClosureEvents
19+
import DummyCaster
20+
import OrderIds
21+
22+
23+
public class ResonatingMaul
24+
static constant CLASSIFICATION = "Permanent"
25+
static constant ICON = "ReplaceableTextures\\CommandButtons\\BTNResonatingMaul.blp"
26+
static constant NAME = "Resonating Maul"
27+
static constant PASSIVE_DESC_1 = "The weaver's \"{0}\" mimics any \"{1}\" being in the area of its effect".format(StormHammer.NAME, ThunderClap.NAME)
28+
static constant PASSIVE_DESC_2 = "Any \"{0}\" mimics the weaver's \"{1}\" being in the area of its effect.".format(StormHammer.NAME, ThunderClap.NAME)
29+
static constant int GOLD_COST = Mindstaff.GOLD_COST * 2 + SobiMask.GOLD_COST + BlacksmithHammer.GOLD_COST + ResonatingMaulRecipe.GOLD_COST
30+
static constant int STR = BlacksmithHammer.STRENGTH
31+
static constant real MANA_REG = SobiMask.MANA_REG_RATE
32+
static constant int MANA = Mindstaff.MANA * 2 + 50
33+
34+
static constant ID = compiletime(ITEM_ID_GEN.next())
35+
static constant ALIAS_ID = compiletime(ITEM_ID_GEN.next())
36+
37+
private static constant DUMMY_ABIL_ID = compiletime(ABIL_ID_GEN.next())
38+
39+
protected static let tooltipGenerator = new ItemTooltipGenerator(NAME, "", GOLD_COST, "")
40+
..addPassiveEffect(PASSIVE_DESC_1)
41+
..addPassiveEffect(PASSIVE_DESC_2)
42+
43+
@compiletime protected static function build()
44+
let attrDef = buildAttributeBonus(NAME, ICON, STR, 0, 0, tooltipGenerator)
45+
let manaRegDef = buildManaRegenerationBonus(NAME, ICON, MANA_REG, tooltipGenerator)
46+
let manaDef = buildManaBonus(NAME, ICON, MANA, tooltipGenerator)
47+
ItemAlias.build(ID, ALIAS_ID)(ItemDefinition def, boolean isAlias) ->
48+
def..setLevel(1)
49+
..setLevelUnclassified(1)
50+
..setLumberCost(0)
51+
..setHitPoints(999999)
52+
..setNumberofCharges(0)
53+
..setStockMaximum(1)
54+
..setStockReplenishInterval(1)
55+
..setStockStartDelay(1)
56+
..setCanBeDropped(true)
57+
..setPerishable(false)
58+
..setActivelyUsed(false)
59+
..setCanBeSoldByMerchants(true)
60+
..setCanBeSoldToMerchants(true)
61+
..setGoldCost(GOLD_COST)
62+
..setClassification(CLASSIFICATION)
63+
..setInterfaceIcon(ICON)
64+
tooltipGenerator.applyToDef(def)
65+
if not isAlias
66+
def.setAbilities(commaList(
67+
attrDef.getNewId(), manaRegDef.getNewId(), manaDef.getNewId()))
68+
new AbilityDefinitionMountainKingThunderClap(DUMMY_ABIL_ID)
69+
..setLevels(ThunderClap.LEVELS)
70+
..presetAOEDamage((int lvl) -> ThunderClap.DAMAGE[lvl - 1])
71+
..presetAttackSpeedReduction((int lvl) -> ThunderClap.ATTACK_SPEED_REDUCTION)
72+
..presetMovementSpeedReduction((int lvl) -> ThunderClap.MOVEMENT_SPEED_REDUCTION)
73+
..presetAreaofEffect((int lvl) -> ThunderClap.AOE)
74+
..presetBuffs((int lvl) -> ThunderClap.BUFF_ID.toRawCode())
75+
..presetDurationHero((int lvl) -> ThunderClap.DURATION)
76+
..presetDurationNormal((int lvl) -> ThunderClap.DURATION)
77+
..presetTargetsAllowed((int lvl) -> ThunderClap.TARGETS_ALLOWED)
78+
..setArtCaster("")
79+
..setArtEffect(ThunderClap.FX_EFFECT)
80+
..setDummyAbility()
81+
82+
protected static function onInit()
83+
new ItemCombine(ID, asList<int>(Mindstaff.ID, Mindstaff.ID, SobiMask.ID, BlacksmithHammer.ID, ResonatingMaulRecipe.ID))
84+
85+
EventListener.onCast(ThunderClap.ID) (unit caster) ->
86+
let casterPos = caster.getPos()
87+
let aoeSq = ThunderClap.AOE.squared()
88+
let p = caster.getOwner()
89+
let lvl = caster.getAbilityLevel(ThunderClap.ID)
90+
for hammer in StormHammer
91+
let hammerPos = hammer.getPos()
92+
if hammer.getPos().distanceToSq(casterPos) <= aoeSq
93+
if caster.hasItemById(ID) or hammer.getCaster().hasItemById(ID)
94+
new DummyCaster
95+
..origin(hammerPos)
96+
..owner(p)
97+
..castImmediate(DUMMY_ABIL_ID, lvl, OrderIds.thunderclap)
98+
99+
100+
101+
public class ResonatingMaulRecipe
102+
static constant CLASSIFICATION = "Permanent"
103+
static constant NAME = "{0} Recipe".format(ResonatingMaul.NAME)
104+
static constant ICON = Icons.bTNSnazzyScrollGreen
105+
static constant int SHOP_X = 2
106+
static constant int SHOP_Y = 1
107+
static constant int GOLD_COST = 600
108+
static constant int ID = compiletime(ITEM_ID_GEN.next())
109+
static constant int ALIAS_ID = compiletime(ITEM_ID_GEN.next())
110+
111+
protected static let tooltipGenerator = ResonatingMaul.tooltipGenerator.copy()
112+
..setName(NAME)
113+
..addRecipeRequirement(Mindstaff.NAME, Mindstaff.GOLD_COST)
114+
..addRecipeRequirement(Mindstaff.NAME, Mindstaff.GOLD_COST)
115+
..addRecipeRequirement(SobiMask.NAME, SobiMask.GOLD_COST)
116+
..addRecipeRequirement(BlacksmithHammer.NAME, BlacksmithHammer.GOLD_COST)
117+
..addRecipeRequirement("Recipe", GOLD_COST)
118+
..setComment("")
119+
120+
@compiletime protected static function build()
121+
ItemAlias.build(ID, ALIAS_ID) (ItemDefinition def, boolean isAlias) ->
122+
def..setLevel(1)
123+
..setLevelUnclassified(1)
124+
..setLumberCost(0)
125+
..setHitPoints(999999)
126+
..setNumberofCharges(0)
127+
..setStockMaximum(1)
128+
..setStockReplenishInterval(1)
129+
..setStockStartDelay(1)
130+
..setCanBeDropped(true)
131+
..setPerishable(false)
132+
..setActivelyUsed(false)
133+
..setCanBeSoldByMerchants(true)
134+
..setCanBeSoldToMerchants(true)
135+
..setAbilities("")
136+
..setGoldCost(GOLD_COST)
137+
..setButtonPositionX(SHOP_X)
138+
..setButtonPositionY(SHOP_Y)
139+
..setClassification(CLASSIFICATION)
140+
..setInterfaceIcon(isAlias ? ResonatingMaul.ICON : ICON)
141+
tooltipGenerator..setName(NAME)
142+
..applyToDef(def, true)
143+
if isAlias
144+
dalaranMerchant.addItemSold(def.getNewId())
145+
146+
147+
init
148+
ResonatingMaul.onInit()

0 commit comments

Comments
 (0)