Skip to content

Commit

Permalink
#216 Fixed gatherer return when trees are cut
Browse files Browse the repository at this point in the history
Updated shredder gather to the new system
  • Loading branch information
MNoya committed Jul 4, 2016
1 parent 0bc78cb commit fda1b12
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 279 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,4 @@

//"ScriptFile" "units/human/peasant.lua"
//"Function" "HideBackpack"

//"MODIFIER_STATE_NO_UNIT_COLLISION" "MODIFIER_STATE_VALUE_ENABLED"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
"AbilityTextureName" "shredder_gather"
"MaxLevel" "1"

"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE"
"AbilityUnitTargetTeam" "DOTA_UNIT_TARGET_TEAM_BOTH"
"AbilityUnitTargetType" "DOTA_UNIT_TARGET_TREE"
"AbilityUnitTargetFlags" "DOTA_UNIT_TARGET_FLAG_INVULNERABLE"

// Mark this as a BuildingHelper ability to skip CancelQueue when cast
"Building" "1"
// Gatherer Key Values
"LumberGainInterval" "1"
"LumberPerInterval" "10"
"DamageTree" "10"

"AbilitySpecial"
{
Expand All @@ -24,70 +26,16 @@
"var_type" "FIELD_INTEGER"
"lumber_per_hit" "10"
}
"03"
{
"var_type" "FIELD_INTEGER"
"damage_to_tree" "10" //mainly here for nightelf wisp to deal 0 damage to trees without having to do a race check
}
}

"OnAbilityPhaseStart"
{
"RunScript"
{
"ScriptFile" "units/builder.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"
"Function" "GatherLumber"
}
}
}
// END LUMBER GATHER
}
"OnSpellStart"
{
"RunScript"
{
"ScriptFile" "units/gather.lua"
"Function" "Gather"
}
}
}

"shredder_return_resources"
Expand All @@ -99,52 +47,12 @@
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE | DOTA_ABILITY_BEHAVIOR_HIDDEN" //Fake Toggle

// When the ability is active, it means there are resources left to return (else it will be hidden)
"OnSpellStart"
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"Function" "ReturnResources"
}
}

"Modifiers"
{
// Shows the stacks of carried lumber
"modifier_carrying_lumber"
{
"IsHidden" "0"
"TextureName" "furion_sprout"

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

// Shows that the builder has acquired gold
"modifier_carrying_gold"
{
"IsHidden" "0"
"TextureName" "alchemist_goblins_greed"

"States"
{
"MODIFIER_STATE_NO_UNIT_COLLISION" "MODIFIER_STATE_VALUE_ENABLED"
}

"OnOrder"
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"Function" "CancelReturn"
}
}
}
}
"OnSpellStart"
{
"RunScript"
{
"ScriptFile" "units/gather.lua"
"Function" "ReturnResources"
}
}
}
136 changes: 21 additions & 115 deletions game/dota_addons/dotacraft/scripts/npc/npc_abilities_custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21418,8 +21418,6 @@

//"ScriptFile" "units/human/peasant.lua"
//"Function" "HideBackpack"

//"MODIFIER_STATE_NO_UNIT_COLLISION" "MODIFIER_STATE_VALUE_ENABLED"
}
"human_gryphon_mounted_rider"
{
Expand Down Expand Up @@ -27237,13 +27235,15 @@
"AbilityTextureName" "shredder_gather"
"MaxLevel" "1"

"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE"
"AbilityUnitTargetTeam" "DOTA_UNIT_TARGET_TEAM_BOTH"
"AbilityUnitTargetType" "DOTA_UNIT_TARGET_TREE"
"AbilityUnitTargetFlags" "DOTA_UNIT_TARGET_FLAG_INVULNERABLE"

// Mark this as a BuildingHelper ability to skip CancelQueue when cast
"Building" "1"
// Gatherer Key Values
"LumberGainInterval" "1"
"LumberPerInterval" "10"
"DamageTree" "10"

"AbilitySpecial"
{
Expand All @@ -27257,70 +27257,16 @@
"var_type" "FIELD_INTEGER"
"lumber_per_hit" "10"
}
"03"
{
"var_type" "FIELD_INTEGER"
"damage_to_tree" "10" //mainly here for nightelf wisp to deal 0 damage to trees without having to do a race check
}
}

"OnAbilityPhaseStart"
{
"RunScript"
{
"ScriptFile" "units/builder.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"
"Function" "GatherLumber"
}
}
}
// END LUMBER GATHER
}
"OnSpellStart"
{
"RunScript"
{
"ScriptFile" "units/gather.lua"
"Function" "Gather"
}
}
}

"shredder_return_resources"
Expand All @@ -27332,54 +27278,14 @@
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE | DOTA_ABILITY_BEHAVIOR_HIDDEN" //Fake Toggle

// When the ability is active, it means there are resources left to return (else it will be hidden)
"OnSpellStart"
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"Function" "ReturnResources"
}
}

"Modifiers"
{
// Shows the stacks of carried lumber
"modifier_carrying_lumber"
{
"IsHidden" "0"
"TextureName" "furion_sprout"

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

// Shows that the builder has acquired gold
"modifier_carrying_gold"
{
"IsHidden" "0"
"TextureName" "alchemist_goblins_greed"

"States"
{
"MODIFIER_STATE_NO_UNIT_COLLISION" "MODIFIER_STATE_VALUE_ENABLED"
}

"OnOrder"
{
"RunScript"
{
"ScriptFile" "units/builder.lua"
"Function" "CancelReturn"
}
}
}
}
"OnSpellStart"
{
"RunScript"
{
"ScriptFile" "units/gather.lua"
"Function" "ReturnResources"
}
}
}
//.RespawnAbility
// Passive version indicates that the hero has already been trained, stopping the next rank of that hero
Expand Down
Loading

0 comments on commit fda1b12

Please sign in to comment.