-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swiper: Boss - Code #2158
Swiper: Boss - Code #2158
Conversation
|
||
caster:Stop() | ||
|
||
local modifier = caster:AddNewModifier(caster, self, "boss_swiper_reapers_rush_active", {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename the modifier to start with modifier_
local modifierTable = {} | ||
modifierTable.speed = self:GetSpecialValueFor("speed") | ||
modifierTable.distance = distance | ||
modifier:InitRush(modifierTable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code should be handled on the modifier itself (OnCreated) , you can send the data needed in the KV parameter
@@ -0,0 +1,80 @@ | |||
function DebugRange(caster, range, ability) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid global function, this could conflict with other functions if we starts making them global.
either move to a helper class on components or put it on the ability/modifier class
|
||
-------------------------------------------------------------------------------- | ||
|
||
function FindUnitsInCone(position, coneDirection, coneLength, coneWidth, teamNumber, teamFilter, typeFilter, flagFilter, order) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid global function, this could conflict with other functions if we starts making them global.
either move to a helper class on components or put it on the ability/modifier class
|
||
-------------------------------------------------------------------------------- | ||
|
||
function PointOnCircle(radius, angle) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid global function, this could conflict with other functions if we starts making them global.
either move to a helper class on components or put it on the ability/modifier class
|
||
-- Swipe | ||
|
||
local swipeRange = thisEntity.hFrontswipeAbility:GetCastRange(thisEntity:GetAbsOrigin(), thisEntity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is nitpicking but if we decide to change an ability in the future would be nince to the AI not to break, null check the abilities if you can
-- Swipe | ||
|
||
local swipeRange = thisEntity.hFrontswipeAbility:GetCastRange(thisEntity:GetAbsOrigin(), thisEntity) | ||
local frontSwipeEnemies = FindUnitsInCone( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find units is expensive, you should only call it if the cooldown is ready
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really think calling FindUnits and iterating over units once per second is any kind of expensive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is one of the slowest methods I've saw in the api but whatever.
I'm just asking to move inside the if statement for is cooldown ready, for all the abilities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved two of them. third is needed for chase/taking best swipe position
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need to find the best swipe position if the swipe is in CD?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it makes sense to take good position in advance. also adds some action to the boss, its boring if he stands still
local thrustMinRange = thisEntity.hThrustAbility:GetSpecialValueFor("target_min_range") | ||
local thrustTarget | ||
local thrustCount = 0 | ||
for k,v in pairs(enemies) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another expensive operation, you should only call it if the cooldown is ready
local reapersRushTarget | ||
local moveToTarget | ||
local reapersRushCount = 0 | ||
for k,v in pairs(enemies) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another expensive operation, you should only call it if the cooldown is ready, and can use the ability
[MODIFIER_STATE_COMMAND_RESTRICTED] = true, | ||
[MODIFIER_STATE_NO_UNIT_COLLISION] = true, | ||
[MODIFIER_STATE_FLYING_FOR_PATHING_PURPOSES_ONLY] = true, | ||
[MODIFIER_STATE_STUNNED] = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more a question then a comment, why it has no collision and is stunned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good practice to disable units during such movement skills. Nothing should interrupt it like autoattack or bodyblocking.
|
local width = self:GetSpecialValueFor("width") | ||
local target = self:GetCursorPosition() | ||
local distance = (target - caster:GetAbsOrigin()):Length2D() | ||
local direction = (target - caster:GetAbsOrigin()):Normalized() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm 99% sure this code will work incorrectly in case of a Z difference (the projectile will travel slower than intended).
|
||
for _, unit in pairs(units) do | ||
local direction = (unit:GetAbsOrigin() - position):Normalized() | ||
if direction:Dot(coneDirection) >= math.cos(coneWidth/2) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
math.cos(coneWidth/2) can be moved into a local variable, it's constant per function call.
|
||
v:EmitSound("hero_ursa.attack") | ||
|
||
local impact = ParticleManager:CreateParticle("particles/econ/items/pudge/pudge_ti6_immortal/pudge_meathook_witness_impact_ti6.vpcf", PATTACH_POINT_FOLLOW, v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I missing something? None of the particles in your code have ReleaseParticleIndex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Position = thisEntity.vInitialSpawnPos | ||
}) | ||
|
||
return 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could probably move 'magic numbers' into constants
|
||
local delay = thisEntity.hFrontswipeAbility:GetCastPoint() + 1.0 | ||
|
||
if math.random(1,4) == 1 then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure you don't want to use that function, use RandomInt
if math.random(1,4) == 1 then | ||
-- thisEntity.hFrontswipeAbility:StartCooldown(8.0) | ||
Timers:CreateTimer(delay - 0.9, function ( ) | ||
thisEntity.hFrontswipeAbility:StartCooldown(8.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the entity is dead at that point?
}) | ||
end | ||
|
||
return 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@l34Um1 I'm not sure if it was decided in the documentation but I think this boss should fall back to right click if all the abilities are in CD and there are enemies nearby
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the abilities are his rightclicks. They shouldn't have cooldowns, he just alternates between them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats wrong with having like 4s cooldown just to tell that this ability isnt available now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure what you mean with your question? His abilities aren't supposed to be "not available". He only uses abilities, never anything else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by "not available" i mean there should be some time window after using some ability(you can regulate swipe rate by editing the cooldown basically)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's important to me is that he only attacks with his swipes. How you achieve that I don't care too much about.
- Added all of swiper's effects for his different actions
- Doubled the size of all ieffects - Improved alpha fade in/out and general transparency - Fixed rotation issues with frontswipe and backswipe - Improved Thrust and Rush alignments & Sword placement/rotation - Generally improved overall visuals & clarity of all effects
The windup on the swipes is too short. They should also have longer range, |
More windup and we gucci |
You sure you want more windup? I just noticed that red spheres (area indicator) appears after some delay but actuall windup starts earlier than that. Maybe i just need to show the indicator at the beginning of windup and thats it? |
I assumed that's how it already worked. So yeah, do that. |
@TideSofDarK you can now merge the latest version of my swiper particles commit. Radius, alpha, and other changes were made so the effects fit better. |
Definitely still needs more windup, dodging it is impossible. But else we gucci. |
@l34Um1 should be fine now |
* Less towers and a bit closer together * Most of the Rest of the Bottles (#2150) * Most of the Rest of the Bottles New bottles and aliasing fixes * Bottle Script Should probably add the script too 🌚 * Fix typo * Fix Typo In script * 1 More Bottle Brickbracks bottle * 😠 * Revert "😠" This reverts commit 73cb48a. * Revert "1 More Bottle" This reverts commit 262ae25. * Clap Travis im sorry it was my fault my bad mate * lul * Travis * Revert "Travis" This reverts commit d50718e. * Subtle Sohei dash value fix (#2154) * Sohei * Same fix as with Dash to guarantee followup opportunities * Fix errors from dota update (#2157) * travis * more travis * member dis * Remove attribute Status Resistance (#2170) * 3.2.1 * Document the release process * Map changes, new props and core item model (#2159) * fixed misalignment in both rad/dire offsides zone. fixed hole in dire large arena zone. requires map rebuild. * travis * rad platform corner * pretty map oaa_test * distribute map * angel and gargoyle statues * fixed some details * loading screen map * more travis * member dis * new fountain for radiant. fixed some particles * new item models for upgrade cores * dire fountain * pregame map screen * added models folder to precache * fixed precache for core models/paarticles * making sure * updated model workflow (#2173) * updated model workflow * wording * Balance (#2169) * Sohei * Phoenix Egg nerf * Refresher Buff * Magic Wand Buff * Spirit Vessel fix * Lycan Boss Buff * Set level cap to 50, remove diminishing stats (#2167) * minor changes * Sets lvl cap and removes diminishing stats MaxLevel = 50 Removes diminishing stats above lvl 25 for heroes and illusions * Revert "minor changes" This reverts commit 82796d4. * correct version * adjust indentation * Electrician code (#2101) * Electrician code shocking * i have your wife and kids hostage travis * Fix Electrician struggling with items * Deaged Electrician from old dog to new dog * Tweaked Electric Shield Made it re-castable while a shield is currently active and gave it an aura_interval AbilitySpecial * Made Cleansing Shock move speed properly % was previously flat due to exhaustion ain't that my life * Made the Static Grip pull modifier temporary might not actually be the cause of a problem but it should probably be this way anyway * Changed ability ids to avoid conflicts * Fix test cases to support talents and massive names * Fixed Static Grip channel time Now matches with the debuff duration when said duration is altered. Also made it so that multiple Static Grips could affect a target at once, to prevent fuckery with Morphling. * Fix ID numbers * Electrician: Model (#2127) * Electrician code shocking * i have your wife and kids hostage travis * Fix Electrician struggling with items * Deaged Electrician from old dog to new dog * Tweaked Electric Shield Made it re-castable while a shield is currently active and gave it an aura_interval AbilitySpecial * Made Cleansing Shock move speed properly % was previously flat due to exhaustion ain't that my life * Made the Static Grip pull modifier temporary might not actually be the cause of a problem but it should probably be this way anyway * Changed ability ids to avoid conflicts * created basic file structure and copied over my blender files. * Fix test cases to support talents and massive names * more textures, animations, etc * materials and added animations to vmdl. still needs Activity links. * minor changes * Fixed Static Grip channel time Now matches with the debuff duration when said duration is altered. Also made it so that multiple Static Grips could affect a target at once, to prevent fuckery with Morphling. * hooking it up * particles and portrait * some stuff * fixed precache * fixed particle, added hitboxes * Fix ID numbers * Compile things * Add Capture Points objectives throughout the game (#2151) * Time remaining function Adde a function to the timer class that returns how much time is left on a specific timer * Capture point compoint barebones Just added basic when it should start * Revert "Capture point compoint barebones" This reverts commit 85731b6. * Revert "Revert "Capture point compoint barebones"" This reverts commit a01de15. * Framwork for accurences of Capture Points Capture point will now happen when they should happen * Test Active capture zones added Enabled captures zones to spawn * Add capture point spots Just a bunch of random spots mirrored ont the map * ADded all the capture zones and pinging functionality * Syntax Fixes * Finished only missing comments * Added Comments * Added tooltip * Now really added tooltips * Revert "Added tooltip" This reverts commit 36140c6. * Revert "Now really added tooltips" This reverts commit 61ba51c. * Hopefully finished with tooltips * Added global variables * Syntax Errors * Add some comments and todos, fix debug enabling line * 3.3.0 * Fix Chatterjee tooltips * Compile minimaps and add Sohei to CM * Map Changes (#2174) Fixed a glitch in the map Created 4 new ward towers. Created new terrain texture materials Water arena "duel_5" can now be enabled in duels.lua * Second Day Spiders: Boss - Code (#2155) * Second Day Spiders: Spidershot ability * Cannonshot; AI * Localization; IDs * More localization * Removed whitespaces * Fixed tabs; Fixed "caster" variable * Added LerpVectors global to .luacheckrc * W431 shadowing fix * Corrected shadowing fix * Fixed sounds; Fixed RandomVector range * Fixed particle release; local functions * Fixed aggro/leash * New ID * BossTier workaround * MagResist fix; Explosion particle fix * Swiper: Boss - Code (#2158) * Frontswipe; backswipe; reaper's rush; thrust * AI; Reworked backswipe * Fixed lua errors * Empty if fix * Fixed backswipe; Fixed followrange * Lua corrections * DG's suggestions * DebugRange ix * Leash mechanic * Better aggro/leash * Swiper boss ability effects - Added all of swiper's effects for his different actions * BossTier workaround * Swipe rework * New IDs * Swiper ability indicator effects adjustments - Doubled the size of all ieffects - Improved alpha fade in/out and general transparency - Fixed rotation issues with frontswipe and backswipe - Improved Thrust and Rush alignments & Sword placement/rotation - Generally improved overall visuals & clarity of all effects * Increased swipe length and windup time * Fixed DebugRange call * Even more windup * Some fixes for new bosses and map minimaps (#2180) * Fixes for the new Bosses (#2179) * Fixes to spiders * Fixed swipe impact * Fixes to swipe * Removed fow_visible flag * 3.4.0
No description provided.