Skip to content

Commit 7e19078

Browse files
committed
updated with changes after fixing some stuff in dotabase-builder, and adding some better typing support via mypy
1 parent 2e0fef6 commit 7e19078

9 files changed

+605
-449
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ session = dotabase_session()
3333
for hero in session.query(Hero):
3434
print(hero)
3535
```
36-
Note that the package was built using python 3.5 and sqlalchemy 1.1
36+
If you use MyPy, you should be able to get typing hints and your editor should recognize that the "hero" variable above is an instance of the "Hero" class.
37+
38+
Note that the package was built using python 3.9 and sqlalchemy 1.4
3739

3840
## JSON files
3941

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.3.8
1+
7.3.9

dotabase/dotabase.db.sql

+400-407
Large diffs are not rendered by default.

dotabase/dotabase.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from sqlalchemy import create_engine
2-
from sqlalchemy.ext.declarative import declarative_base
32
from sqlalchemy import Column, Integer, String, Float, Boolean, ForeignKey, Table, Date, DateTime
4-
from sqlalchemy.orm import sessionmaker, relationship
5-
import sqlalchemy.orm.session as sqlsession
3+
from sqlalchemy.orm import relationship, Session, declarative_base
64
import os
75

86
# The absolute path to the dotabase Python package
@@ -172,6 +170,7 @@ class Item(Base):
172170
neutral_tier = Column(String)
173171
ability_special = Column(String)
174172
recipe = Column(String)
173+
shop_tags = Column(String)
175174

176175
json_data = Column(String)
177176

@@ -271,10 +270,10 @@ class Patch(Base):
271270
custom_url = Column(String)
272271
wiki_url = Column(String)
273272

273+
274274
# returns an open dotabase session
275275
# if recreate is true, deletes any existing database first
276-
def dotabase_session() -> sqlsession.Session:
276+
def dotabase_session() -> Session:
277277
engine = create_engine('sqlite:///' + dotabase_db)
278278
Base.metadata.create_all(engine)
279-
Session = sessionmaker(bind=engine)
280-
return Session()
279+
return Session(engine)

json/abilities.json

+12-31
Original file line numberDiff line numberDiff line change
@@ -12914,10 +12914,6 @@
1291412914
"name": "special_bonus_unique_disruptor_9",
1291512915
"behavior": "passive",
1291612916
"ability_special": [
12917-
{
12918-
"key": "value",
12919-
"value": "275"
12920-
},
1292112917
{
1292212918
"key": "bonus_max_damage",
1292312919
"value": "250"
@@ -12933,13 +12929,7 @@
1293312929
"ID": "788",
1293412930
"AbilityType": "DOTA_ABILITY_TYPE_ATTRIBUTES",
1293512931
"AbilityBehavior": "DOTA_ABILITY_BEHAVIOR_PASSIVE",
12936-
"AbilitySpecial": {
12937-
"01": {
12938-
"var_type": "FIELD_INTEGER",
12939-
"value": "275",
12940-
"ad_linked_abilities": "disruptor_glimpse"
12941-
}
12942-
}
12932+
"BaseClass": "special_bonus_base"
1294312933
}
1294412934
},
1294512935
{
@@ -19286,7 +19276,8 @@
1928619276
"name": "shadow_demon_disseminate",
1928719277
"hero_id": 79,
1928819278
"behavior": "unit_target",
19289-
"target_team": "both|",
19279+
"spell_immunity": "no",
19280+
"target_team": "both",
1929019281
"cast_range": "700 800 900 1000",
1929119282
"cast_point": "0.3",
1929219283
"cooldown": "30 26 22 18",
@@ -19318,9 +19309,9 @@
1931819309
"json_data": {
1931919310
"ID": "1001",
1932019311
"AbilityBehavior": "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET",
19321-
"AbilityUnitTargetTeam": "DOTA_UNIT_TARGET_TEAM_BOTH | ",
19312+
"AbilityUnitTargetTeam": "DOTA_UNIT_TARGET_TEAM_BOTH",
1932219313
"AbilityUnitTargetType": "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC",
19323-
"AbilityUnitTargetFlags": "DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES | DOTA_UNIT_TARGET_FLAG_INVULNERABLE",
19314+
"SpellImmunityType": "SPELL_IMMUNITY_ENEMIES_NO",
1932419315
"AbilitySound": "Hero_ShadowDemon.Soul_Catcher",
1932519316
"AbilityCooldown": "30 26 22 18",
1932619317
"AbilityCastRange": "700 800 900 1000",
@@ -19577,7 +19568,7 @@
1957719568
"slot": 4,
1957819569
"icon": "/panorama/images/spellicons/naga_siren_reel_in_png.png",
1957919570
"localized_name": "Reel In",
19580-
"description": "Naga Siren channels for up to %AbilityChannelTime% seconds, pulling all ensnared units in a **1400** range towards her at a speed of **150**.",
19571+
"description": "Naga Siren channels for up to **5** seconds, pulling all units affected by Naga's Ensnare in a **1400** range towards her at a speed of **150**.",
1958119572
"lore": "Even the youngest Slithereen are well schooled in trawling for prey with nothing but their wits and nets.",
1958219573
"scepter_grants": true,
1958319574
"scepter_upgrades": false,
@@ -24446,7 +24437,7 @@
2444624437
"scepter_upgrades": false,
2444724438
"shard_grants": false,
2444824439
"shard_upgrades": true,
24449-
"shard_description": "Lina's abilities deal %shard_bonus_spell_damage% more damage for each Fiery Soul Charge.",
24440+
"shard_description": "Lina's abilities deal **15** more damage for each Fiery Soul Charge.",
2445024441
"json_data": {
2445124442
"ID": "5042",
2445224443
"AbilityBehavior": "DOTA_ABILITY_BEHAVIOR_PASSIVE",
@@ -24562,7 +24553,8 @@
2456224553
},
2456324554
{
2456424555
"key": "damage",
24565-
"value": "80 140 200 260"
24556+
"value": "80 140 200 260",
24557+
"header": "DAMAGE:"
2456624558
},
2456724559
{
2456824560
"key": "width",
@@ -40193,7 +40185,7 @@
4019340185
"scepter_upgrades": false,
4019440186
"shard_grants": false,
4019540187
"shard_upgrades": true,
40196-
"shard_description": "Causes Poison Touch to hex affected targets for %shard_hex_duration% seconds.",
40188+
"shard_description": "Causes Poison Touch to hex affected targets for **2** seconds.",
4019740189
"json_data": {
4019840190
"ID": "5233",
4019940191
"AbilityBehavior": "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET",
@@ -57979,7 +57971,7 @@
5797957971
"scepter_upgrades": false,
5798057972
"shard_grants": false,
5798157973
"shard_upgrades": true,
57982-
"shard_description": "Song of the Siren heals allies by %shard_heal_pct% of their Max HP per second for its duration.",
57974+
"shard_description": "Song of the Siren heals allies by **5%** of their Max HP per second for its duration.",
5798357975
"json_data": {
5798457976
"ID": "5470",
5798557977
"AbilityType": "DOTA_ABILITY_TYPE_ULTIMATE",
@@ -59565,7 +59557,6 @@
5956559557
"json_data": {
5956659558
"ID": "5489",
5956759559
"AbilityBehavior": "DOTA_ABILITY_BEHAVIOR_HIDDEN | DOTA_ABILITY_BEHAVIOR_NO_TARGET",
59568-
"MaxLevel": "1",
5956959560
"AbilityCastPoint": "0 0 0 0",
5957059561
"AbilityCastAnimation": "ACT_INVALID",
5957159562
"AbilityCooldown": "1.0 1.0 1.0 1.0"
@@ -92474,10 +92465,6 @@
9247492465
"name": "special_bonus_unique_disruptor_4",
9247592466
"behavior": "passive",
9247692467
"ability_special": [
92477-
{
92478-
"key": "value",
92479-
"value": "12"
92480-
},
9248192468
{
9248292469
"key": "bonus_AbilityCooldown",
9248392470
"value": "12"
@@ -92493,13 +92480,7 @@
9249392480
"ID": "6630",
9249492481
"AbilityType": "DOTA_ABILITY_TYPE_ATTRIBUTES",
9249592482
"AbilityBehavior": "DOTA_ABILITY_BEHAVIOR_PASSIVE",
92496-
"AbilitySpecial": {
92497-
"01": {
92498-
"var_type": "FIELD_INTEGER",
92499-
"value": "12",
92500-
"ad_linked_abilities": "disruptor_glimpse"
92501-
}
92502-
}
92483+
"BaseClass": "special_bonus_base"
9250392484
}
9250492485
},
9250592486
{

json/heroes.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27862,7 +27862,7 @@
2786227862
"RareIdleExpression": "scenes/primal_beast/primal_beast_exp_idle_02.vcd",
2786327863
"SoundSet": "Hero_PrimalBeast",
2786427864
"Enabled": "1",
27865-
"CMEnabled": "0",
27865+
"CMEnabled": "1",
2786627866
"HeroUnlockOrder": "1",
2786727867
"Role": "Initiator,Durable,Disabler",
2786827868
"Rolelevels": "3,3,2",

0 commit comments

Comments
 (0)