Skip to content

Commit 15fecca

Browse files
committed
Run prettier on all articles
Fixes #39
1 parent 6422ab8 commit 15fecca

83 files changed

Lines changed: 2590 additions & 2471 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/_articles/*
2-
!/_articles/panorama
3-
/_articles/panorama/*
4-
!/_articles/panorama/react.md
5-
!/_articles/panorama/webpack.md
6-
!/_articles/scripting/vector-math.md
7-
81
.vitepress/cache
92
.vitepress/dist
103
/build

_articles/abilities/ability-keyvalues.md

Lines changed: 135 additions & 127 deletions
Large diffs are not rendered by default.

_articles/abilities/abilityduration-tooltips.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ date: 15.12.2014
77

88
# AbilityDuration tooltips
99

10-
1110
**TL;DR:** AbilityDuration is a fairly useless keyvalue because whoever coded it forgot to make an automatic tooltip like with `AbilityDamage`. Use a "duration" AbilityValue and connect it with lua instead.
1211

1312
Imagine you want to have an ability apply a modifier for some seconds, duration changing with levels.
@@ -22,11 +21,11 @@ And then have your modifier refer to %AbilityDuration in the "Duration" modifier
2221

2322
But when you want to indicate that your ability lasts for said duration, this AbilityDuration doesn't generate a **"DURATION:"** tooltip by itself, so you have 3 options:
2423

25-
**Option 1.** Write "Last 3 seconds at level 1 and then 2 at level 2 and 3" in the _Description.
24+
**Option 1.** Write "Last 3 seconds at level 1 and then 2 at level 2 and 3" in the \_Description.
2625

2726
This is bad for the reasons explained before.
2827

29-
**Option 2*.** Have a "duration" AbilityValue in addition to the "AbilityDuration" and keep both values synchronized.
28+
**Option 2\*.** Have a "duration" AbilityValue in addition to the "AbilityDuration" and keep both values synchronized.
3029

3130
Suboptimal but decent solution, as it allows you to use ability:GetAbilityDuration() which takes its value from AbilityDuration.
3231

_articles/abilities/calling-spells-with-setcursor.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ date: 10.01.2015
77

88
# Calling Spells with SetCursor
99

10-
1110
`CDotaBaseAbility:OnSpellStart` in combination with `CDotaBaseNPC:SetCursorCastTarget` and `CDOTABaseNPC:SetCursorPosition` are used to "Call" spells.
1211

1312
This is a powerful way to interact with Valve's spells in particular. This allows you to:
1413

15-
* Activate hidden abilities
16-
* Ignore turn-restrictions
17-
* Ignore castpoint or cooldown
18-
* Ignore any other cruft associated with the formal spell-casting methods
14+
- Activate hidden abilities
15+
- Ignore turn-restrictions
16+
- Ignore castpoint or cooldown
17+
- Ignore any other cruft associated with the formal spell-casting methods
1918

2019
This is easy to use, easy to configure and easy to think about. Here is an example that casts Tether on a hidden dummy unit, activated by a datadriven spell:
2120

@@ -26,4 +25,3 @@ tether:EndCooldown()
2625
caster:SetCursorCastTarget(dummy)
2726
tether:OnSpellStart()
2827
```
29-

_articles/abilities/creating-innate-abilities.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ date: 27.09.2019
77

88
# Creating innate (available from level 1) abilities
99

10-
1110
This article will guide you through creating an ability which is available to the given hero right away, like Earth Spirit's Stone Remnant.
1211
This guide assumes you already have an ability set up on a hero.
1312

@@ -27,6 +26,7 @@ end
2726
## Datadriven and builtin abilities
2827

2928
The plan is:
29+
3030
1. Subscribe to the hero spawn event
3131
2. Determine if the spawned hero has a specific ability
3232
3. Level it up
@@ -52,7 +52,7 @@ Let's create the `HandleNpcSpawned` function, put it in the same file just below
5252
function HandleNpcSpawned(entityIndex)
5353
local entity = EntIndexToHScript(entityIndex)
5454
local innateAbilityName = "my_innate_ability"
55-
55+
5656
if entity:IsRealHero() and entity:HasAbility(innateAbilityName) then
5757
entity:FindAbilityByName(innateAbilityName):SetLevel(1)
5858
end

_articles/abilities/datadriven/all-about-the-target.md

Lines changed: 69 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ date: 23.01.2015
77

88
# All about the Target
99

10-
1110
I wanted to review a very old thread which was posted almost one year ago but still isn't completely well documented anywhere:
1211

1312
> "Target" is one bitch of a key.
@@ -18,7 +17,7 @@ Having a wrong `"Target"` block is the number one reason of having to relaunch t
1817

1918
Quoting the [wiki](https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Scripting/Abilities_Data_Driven#Action_Target_Values) on this:
2019

21-
> Note: These names mean different things in different events. It may require some experimentation to discover exactly what in each case.
20+
> Note: These names mean different things in different events. It may require some experimentation to discover exactly what in each case.
2221
2322
This thread intends to compile every Target-related decision.
2423

@@ -30,121 +29,120 @@ After running many tests with different ability behaviors, here's what I got:
3029

3130
### Behavior: DOTA_ABILITY_BEHAVIOR_NO_TARGET
3231

33-
Event | Target
34-
--|--
35-
OnSpellStart | CASTER, UNIT, ATTACKER
36-
OnAbilityPhaseStart | CASTER, UNIT, ATTACKER
32+
| Event | Target |
33+
| ------------------- | ---------------------- |
34+
| OnSpellStart | CASTER, UNIT, ATTACKER |
35+
| OnAbilityPhaseStart | CASTER, UNIT, ATTACKER |
3736

3837
### DOTA_ABILITY_BEHAVIOR_UNIT_TARGET
3938

4039
This behavior adds TARGET as a possible value for the Target key:
4140

42-
Event | Target
43-
--|--
44-
OnSpellStart | CASTER, TARGET, UNIT, ATTACKER
45-
OnAbilityPhaseStart | CASTER, TARGET, UNIT, ATTACKER
41+
| Event | Target |
42+
| ------------------- | ------------------------------ |
43+
| OnSpellStart | CASTER, TARGET, UNIT, ATTACKER |
44+
| OnAbilityPhaseStart | CASTER, TARGET, UNIT, ATTACKER |
4645

4746
### AbilityChannelTime > 0
4847

49-
`DOTA_ABILITY_BEHAVIOR_CHANNELLED` only purpose is to change the ability Tooltip to *"Channeled"*. In fact, the `BEHAVIOR_CHANNELED` isn't even needed, `"AbilityChannelTime"` is all that matters for the actual ability behavior.
48+
`DOTA_ABILITY_BEHAVIOR_CHANNELLED` only purpose is to change the ability Tooltip to _"Channeled"_. In fact, the `BEHAVIOR_CHANNELED` isn't even needed, `"AbilityChannelTime"` is all that matters for the actual ability behavior.
5049

51-
Event | Target
52-
--|--
53-
OnChannelFinish | CASTER, TARGET, UNIT, ATTACKER
54-
OnChannelInterrupted | CASTER, TARGET, UNIT, ATTACKER
55-
OnChannelSucceeded | CASTER, TARGET, UNIT, ATTACKER
50+
| Event | Target |
51+
| -------------------- | ------------------------------ |
52+
| OnChannelFinish | CASTER, TARGET, UNIT, ATTACKER |
53+
| OnChannelInterrupted | CASTER, TARGET, UNIT, ATTACKER |
54+
| OnChannelSucceeded | CASTER, TARGET, UNIT, ATTACKER |
5655

5756
### With Linear and Tracking Projectile Actions
5857

59-
Event | Target
60-
--|--
61-
OnProjectileFinish | CASTER, TARGET, PROJECTILE
62-
OnProjectileHitUnit | CASTER, TARGET, PROJECTILE
58+
| Event | Target |
59+
| ------------------- | -------------------------- |
60+
| OnProjectileFinish | CASTER, TARGET, PROJECTILE |
61+
| OnProjectileHitUnit | CASTER, TARGET, PROJECTILE |
6362

6463
### DOTA_ABILITY_BEHAVIOR_TOGGLE
6564

66-
Event | Target
67-
--|--
68-
OnToggleOff | CASTER
69-
OnToggleOn | CASTER
65+
| Event | Target |
66+
| ----------- | ------ |
67+
| OnToggleOff | CASTER |
68+
| OnToggleOn | CASTER |
7069

7170
### Item pickup and drop
7271

73-
Event | Target
74-
--|--
75-
OnEquip | CASTER
76-
OnUnequip | CASTER
72+
| Event | Target |
73+
| --------- | ------ |
74+
| OnEquip | CASTER |
75+
| OnUnequip | CASTER |
7776

7877
### Any Behavior
7978

80-
Event | Target
81-
--|--
82-
OnOwnerDied | CASTER
83-
OnOwnerSpawned | CASTER
84-
OnUpgrade | CASTER
85-
79+
| Event | Target |
80+
| -------------- | ------ |
81+
| OnOwnerDied | CASTER |
82+
| OnOwnerSpawned | CASTER |
83+
| OnUpgrade | CASTER |
8684

8785
## MODIFIER EVENT CONTEXTS
8886

8987
### Caster-Target
9088

9189
Target always refers to the owner of the modifier.
9290

93-
Event | Target
94-
--|--
95-
OnCreated | CASTER, TARGET
96-
OnDestroy | CASTER, TARGET
97-
OnIntervalThink | CASTER, TARGET
98-
OnProjectileDodge | CASTER, TARGET
91+
| Event | Target |
92+
| ----------------- | -------------- |
93+
| OnCreated | CASTER, TARGET |
94+
| OnDestroy | CASTER, TARGET |
95+
| OnIntervalThink | CASTER, TARGET |
96+
| OnProjectileDodge | CASTER, TARGET |
9997

10098
### Damage
10199

102100
In these events we can send an extra parameter, referenced as %attack_damage
103101

104102
Note that this is not a value taken from an AbilityValues, instead it is generated by the system to be used in very particular events.
105103

106-
Event | Target | %attack_damage value
107-
--|--|--
108-
OnTakeDamage | CASTER, UNIT, ATTACKER | post reduction
109-
OnDealDamage | CASTER, UNIT, ATTACKER | post reduction
104+
| Event | Target | %attack_damage value |
105+
| ------------ | ---------------------- | -------------------- |
106+
| OnTakeDamage | CASTER, UNIT, ATTACKER | post reduction |
107+
| OnDealDamage | CASTER, UNIT, ATTACKER | post reduction |
110108

111109
### Attacks
112110

113111
In some of the attack events we can also use the %attack_damage
114112

115-
Event | Target | %attack_damage value
116-
--|--|--
117-
OnAttack | CASTER, TARGET, ATTACKER | 0
118-
OnAttackStart | CASTER, TARGET, ATTACKER | 0
119-
OnAttackAllied | CASTER, TARGET, ATTACKER | 0
120-
OnAttacked | CASTER, TARGET, ATTACKER | post reduction
121-
OnAttackLanded | CASTER, TARGET, ATTACKER | **before** reduction, the real attack value
122-
OnAttackFailed | CASTER, TARGET, ATTACKER | **before** reduction, the real attack value
113+
| Event | Target | %attack_damage value |
114+
| -------------- | ------------------------ | ------------------------------------------- |
115+
| OnAttack | CASTER, TARGET, ATTACKER | 0 |
116+
| OnAttackStart | CASTER, TARGET, ATTACKER | 0 |
117+
| OnAttackAllied | CASTER, TARGET, ATTACKER | 0 |
118+
| OnAttacked | CASTER, TARGET, ATTACKER | post reduction |
119+
| OnAttackLanded | CASTER, TARGET, ATTACKER | **before** reduction, the real attack value |
120+
| OnAttackFailed | CASTER, TARGET, ATTACKER | **before** reduction, the real attack value |
123121

124122
### Killing
125123

126-
Event | Target
127-
--|--
128-
OnDeath | CASTER, UNIT, ATTACKER
129-
OnKill | CASTER, UNIT, ATTACKER
130-
OnHeroKilled | CASTER, TARGET, ATTACKER
124+
| Event | Target |
125+
| ------------ | ------------------------ |
126+
| OnDeath | CASTER, UNIT, ATTACKER |
127+
| OnKill | CASTER, UNIT, ATTACKER |
128+
| OnHeroKilled | CASTER, TARGET, ATTACKER |
131129

132130
### Caster-Unit
133131

134-
Event | Target | Extra
135-
--|--|--
136-
OnAbilityEndChannel | CASTER, UNIT | TARGET if the ability isn't NO_TARGET
137-
OnAbilityExecuted | CASTER, UNIT | TARGET if the ability isn't NO_TARGET
138-
OnOrder | CASTER, UNIT | TARGET if the Order is an ability with target
139-
OnRespawn | CASTER, UNIT | needs "Attributes" "PERMANENT" on its modifier
140-
OnManaGained | CASTER, UNIT |
141-
OnSpentMana | CASTER, UNIT |
142-
OnStateChanged | CASTER, UNIT |
143-
OnTeleporting | CASTER, UNIT |
144-
OnTeleported | CASTER, UNIT |
145-
OnUnitMoved | CASTER, UNIT |
146-
OnHealReceived | CASTER, UNIT |
147-
OnHealthGained | CASTER, UNIT |
132+
| Event | Target | Extra |
133+
| ------------------- | ------------ | ---------------------------------------------- |
134+
| OnAbilityEndChannel | CASTER, UNIT | TARGET if the ability isn't NO_TARGET |
135+
| OnAbilityExecuted | CASTER, UNIT | TARGET if the ability isn't NO_TARGET |
136+
| OnOrder | CASTER, UNIT | TARGET if the Order is an ability with target |
137+
| OnRespawn | CASTER, UNIT | needs "Attributes" "PERMANENT" on its modifier |
138+
| OnManaGained | CASTER, UNIT |
139+
| OnSpentMana | CASTER, UNIT |
140+
| OnStateChanged | CASTER, UNIT |
141+
| OnTeleporting | CASTER, UNIT |
142+
| OnTeleported | CASTER, UNIT |
143+
| OnUnitMoved | CASTER, UNIT |
144+
| OnHealReceived | CASTER, UNIT |
145+
| OnHealthGained | CASTER, UNIT |
148146

149147
### Never Triggered
150148

_articles/abilities/datadriven/apply-hero-and-creep-modifier-durations.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ date: 15.01.2015
77

88
# Apply Hero and Creep modifier durations
99

10-
1110
I came up with this method after kritth showed us that you can directly add a `"Duration"` key value to an `"ApplyModifier"` block and the use of the `"Target"` block without a Radius (defaulting to 0).
1211

1312
Basically, abusing the datadriven system we can do this on any event:
@@ -21,7 +20,7 @@ Basically, abusing the datadriven system we can do this on any event:
2120
"Center" "TARGET"
2221
"Types" "DOTA_UNIT_TARGET_HERO"
2322
}
24-
"Duration" "%hero_duration"
23+
"Duration" "%hero_duration"
2524
}
2625
2726
"ApplyModifier"

_articles/abilities/datadriven/channeling-animations.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ date: 18.01.2015
77

88
# Channeling Animations
99

10-
1110
## Short Version:
1211

13-
ApplyModifier with short duration in a OnThinkInterval, channeling modifier has an OverrideAnimation with a ACT_ from the [Action List](https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Actions_List) or with the method explained later.
12+
ApplyModifier with short duration in a OnThinkInterval, channeling modifier has an OverrideAnimation with a ACT\_ from the [Action List](https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Actions_List) or with the method explained later.
1413

1514
**Short Version Example:**
15+
1616
```
1717
"Modifiers"
1818
{
@@ -45,13 +45,14 @@ ApplyModifier with short duration in a OnThinkInterval, channeling modifier has
4545

4646
Instead of trying to find the desired animation in the Action List on the wiki, you can view the animations on the model you are trying to use and their respective names.
4747

48-
For this, go to the Asset Browser, type your hero name + *vmdl*, in this case I'm going to use drow.vmdl. Double click it, you will enter the Model Editor. In here, you want to go to the top tabs and click Tools -> View Sequences.
48+
For this, go to the Asset Browser, type your hero name + _vmdl_, in this case I'm going to use drow.vmdl. Double click it, you will enter the Model Editor. In here, you want to go to the top tabs and click Tools -> View Sequences.
4949

50-
After this, you can select any animation and it will animate the white blocks at the right. To get the ACT_ name, you can click Properties then open the Activities box, or just tick down the Activity checkbox in the Sequences window, which will show how all the animations are refered ingame.
50+
After this, you can select any animation and it will animate the white blocks at the right. To get the ACT\_ name, you can click Properties then open the Activities box, or just tick down the Activity checkbox in the Sequences window, which will show how all the animations are refered ingame.
5151

5252
**Note**: Ignore the +string.
5353

5454
**Full Example**:
55+
5556
```
5657
"dark_ranger_life_drain"
5758
{

_articles/abilities/datadriven/datadriven-ability-events-modifiers.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ date: 10.12.2014
77

88
# DataDriven Ability Events & Modifiers
99

10-
11-
A guide that tries to cover every Ability & Modifier Event of the *ability_datadriven* system, with examples.
10+
A guide that tries to cover every Ability & Modifier Event of the _ability_datadriven_ system, with examples.
1211

1312
![img](/images/external/T7W828Q.png)
1413

1514
<a name="start"></a>
16-
This is an Intermediate guide that expects some knowledge of the most common first-level keyvalues. If unsure about the meaning of any of them, check the [DataDriven Ability Breakdown](/abilities/ability-keyvalues).
15+
This is an Intermediate guide that expects some knowledge of the most common first-level keyvalues.
16+
If unsure about the meaning of any of them, check the [DataDriven Ability
17+
Breakdown](/abilities/ability-keyvalues).
1718

1819
## Introduction
1920

@@ -30,6 +31,7 @@ There are 2 types, **Ability Events** and **Modifier Events**.
3031
Ability Events go on the "first level" of the ability. Modifier Events need to be inside a modifier block.
3132

3233
Basic Skeleton looks like this:
34+
3335
```
3436
"ability_custom"
3537
{
@@ -65,7 +67,7 @@ To test if your Event is actually happening when you expect, you can add the fol
6567
}
6668
```
6769

68-
`RunScript` is one of the most common and potent Actions you'll use for creating complex abilities. For it to work, you need to have a Script File, in this case *utilities.lua*, inside the vscripts folder.
70+
`RunScript` is one of the most common and potent Actions you'll use for creating complex abilities. For it to work, you need to have a Script File, in this case _utilities.lua_, inside the vscripts folder.
6971

7072
The Function called can have this:
7173

0 commit comments

Comments
 (0)