Skip to content

Commit

Permalink
#216 Refectoring begins
Browse files Browse the repository at this point in the history
gather.lua callbacks, getting rid of datadriven OnOrder with filters
instead.
  • Loading branch information
MNoya committed May 26, 2016
1 parent ad53d86 commit ba67b3d
Show file tree
Hide file tree
Showing 20 changed files with 1,379 additions and 538 deletions.
2 changes: 1 addition & 1 deletion content/dota_addons/dotacraft/panorama/scripts/clicks.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function OnRightButtonPressed()
}

// Builder Right Click
if ( IsBuilder( mainSelected ) )
if ( IsBuilder( mainSelected ) || Entities.GetUnitName(mainSelected) == "undead_ghoul" ) //TODO: Proper Gatherer click handler
{
// Cancel BH
if (!pressedShift) SendCancelCommand()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,79 +38,33 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "Gather"
}
}

"Modifiers"
{
// LUMBER GATHER
"modifier_on_order_cancel_lumber"
{
"IsHidden" "1"
"OnOrder"
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"Function" "CancelGather"
}
}

// Builders have no collision while moving to gather
"States"
{
"MODIFIER_STATE_NO_UNIT_COLLISION" "MODIFIER_STATE_VALUE_ENABLED"
}
}

"modifier_gathering_lumber"
{
"OverrideAnimation" "ACT_DOTA_ATTACK"
"IsHidden" "1"
"OnOrder"
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"Function" "CancelGather"
}
}

// Lumber Gain
"ThinkInterval" "1.0"
"OnIntervalThink"
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "GatherLumber"
}
}
}
// END LUMBER GATHER

// GOLD GATHER
"modifier_on_order_cancel_gold"
{
"IsHidden" "1"
"OnOrder"
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"Function" "CancelGather"
}
}

// Builders have no collision while moving to gather
"States"
{
"MODIFIER_STATE_NO_UNIT_COLLISION" "MODIFIER_STATE_VALUE_ENABLED"
}
}

"modifier_gathering_gold"
{
"States"
Expand All @@ -127,7 +81,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "GatherGold"
}
}
Expand All @@ -142,7 +96,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "CancelGather"
}
}
Expand All @@ -157,7 +111,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "CancelGather"
}

Expand Down Expand Up @@ -197,7 +151,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "Repair"
}
}
Expand Down Expand Up @@ -234,7 +188,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "ReturnResources"
}
}
Expand All @@ -247,15 +201,6 @@
"IsHidden" "0"
"TextureName" "furion_sprout"

"OnOrder"
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"Function" "CancelReturn"
}
}

"OnCreated"
{
"RunScript"
Expand Down Expand Up @@ -286,15 +231,6 @@
"MODIFIER_STATE_NO_UNIT_COLLISION" "MODIFIER_STATE_VALUE_ENABLED"
}

"OnOrder"
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"Function" "CancelReturn"
}
}

"OnCreated"
{
"RunScript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
"AbilityTextureName" "nightelf_gather"
"MaxLevel" "1"

"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET"
"AbilityUnitTargetTeam" "DOTA_UNIT_TARGET_TEAM_BOTH"
"AbilityUnitTargetType" "DOTA_UNIT_TARGET_BASIC | DOTA_UNIT_TARGET_TREE | DOTA_UNIT_TARGET_BUILDING | DOTA_UNIT_TARGET_HERO"
"AbilityUnitTargetFlags" "DOTA_UNIT_TARGET_FLAG_INVULNERABLE"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET"
"AbilityUnitTargetTeam" "DOTA_UNIT_TARGET_TEAM_BOTH"
"AbilityUnitTargetType" "DOTA_UNIT_TARGET_BASIC | DOTA_UNIT_TARGET_TREE | DOTA_UNIT_TARGET_BUILDING | DOTA_UNIT_TARGET_HERO"
"AbilityUnitTargetFlags" "DOTA_UNIT_TARGET_FLAG_INVULNERABLE"

"RequiresEmptyTree" "1"
"GoldMineTarget" "nightelf_entangled_gold_mine"

"AbilitySpecial"
{
Expand All @@ -34,8 +37,7 @@
{
"var_type" "FIELD_INTEGER"
"gold_per_interval" "10"
}

}
}

"precache"
Expand All @@ -48,7 +50,7 @@
// Move towards the tree, repeat until ~100 distance
// Only one wisp per tree, if tree busy find another
// OnOrder, toggle off and cancel the skill
// When close to the tree, give the wisp flying movement and position it on top
// When close to the tree, smoothly move the wisp on top
// Modifier generates lumber every think interval, OnOrder cancels
// If possible try to make some circular rotation around the tree

Expand All @@ -64,7 +66,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "Gather"
}
}
Expand All @@ -78,7 +80,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "CancelGather"
}
}
Expand All @@ -95,7 +97,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "CancelGather"
}
}
Expand All @@ -104,7 +106,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "CancelGather"
}
}
Expand All @@ -114,12 +116,12 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "LumberGain"
}
}

"States"
"States" //TODO: Fix #217
{
"MODIFIER_STATE_FLYING" "MODIFIER_STATE_VALUE_ENABLED"
}
Expand All @@ -132,7 +134,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "CancelGather"
}
}
Expand All @@ -152,7 +154,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "GoldGain"
}
}
Expand All @@ -175,7 +177,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "CancelGather"
}
}
Expand All @@ -193,7 +195,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "CancelGather"
}

Expand Down Expand Up @@ -225,7 +227,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "Repair"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "CancelGather"
}
}
Expand All @@ -156,7 +156,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "CancelGather"
}

Expand Down Expand Up @@ -218,7 +218,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "ReturnResources"
}
}
Expand All @@ -235,7 +235,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "CancelReturn"
}
}
Expand All @@ -256,7 +256,7 @@
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"ScriptFile" "units/gather.lua"
"Function" "CancelReturn"
}
}
Expand Down
Loading

0 comments on commit ba67b3d

Please sign in to comment.