Skip to content

Commit

Permalink
unit: Added the 'Blend Master' with 'Camouflage'
Browse files Browse the repository at this point in the history
  • Loading branch information
xescugc committed Jun 6, 2024
1 parent 8cfd9df commit 68313c1
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 25 deletions.
8 changes: 4 additions & 4 deletions assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ var ButterflyWalk_png []byte
//go:embed ninja_adventure_asset_pack/Actor/Monsters/Butterfly/Faceset.png
var ButterflyFaceset_png []byte

//go:embed ninja_adventure_asset_pack/Actor/Characters/NinjaMasked/SeparateAnim/Walk.png
var NinjaMaskedWalk_png []byte
//go:embed ninja_adventure_asset_pack/Actor/Characters/CamouflageRed/SeparateAnim/Walk.png
var BlendMasterWalk_png []byte

//go:embed ninja_adventure_asset_pack/Actor/Characters/NinjaMasked/Faceset.png
var NinjaMaskedFaceset_png []byte
//go:embed ninja_adventure_asset_pack/Actor/Characters/CamouflageRed/Faceset.png
var BlendMasterFaceset_png []byte

//go:embed ninja_adventure_asset_pack/Actor/Characters/RobotGrey/SeparateAnim/Walk.png
var RobotWalk_png []byte
Expand Down
5 changes: 3 additions & 2 deletions assets/units.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@
"environment":"aerial",
"movement_speed": 30
},
"ninja_masked":{
"blend_master":{
"health": 10,
"gold": 15,
"keybind":"8",
"environment":"terrestrial",
"movement_speed": 50
"movement_speed": 40,
"abilities":["camouflage"]
},
"robot":{
"health": 5,
Expand Down
29 changes: 23 additions & 6 deletions store/lines.go
Original file line number Diff line number Diff line change
Expand Up @@ -934,20 +934,37 @@ func (ls *Lines) moveLineUnitsTo(lstate LinesState, lid int, t time.Time) {
var (
minDist float64 = 0
minDistUnit *Unit

// The potential Camouflage units
minDistCam float64 = 0
minDistCamUnit *Unit
)
for _, u := range l.Units {
if !tw.CanTarget(unit.Units[u.Type].Environment) || u.HasBuff(buff.Burrowoed) || u.HasBuff(buff.Resurrecting) {
continue
}
d := tw.PDistance(u.Object)
if minDist == 0 {
minDist = d
}
if d <= tower.Towers[tw.Type].Range && d <= minDist {
minDist = d
minDistUnit = u
if u.HasAbility(ability.Camouflage) {
if minDistCam == 0 {
minDistCam = d
}
if d <= tower.Towers[tw.Type].Range && d <= minDistCam {
minDistCam = d
minDistCamUnit = u
}
} else {
if minDist == 0 {
minDist = d
}
if d <= tower.Towers[tw.Type].Range && d <= minDist {
minDist = d
minDistUnit = u
}
}
}
if minDistUnit == nil && minDistCamUnit != nil {
minDistUnit = minDistCamUnit
}
if minDistUnit != nil {
// Tower Attack
if minDistUnit.Shield != 0 {
Expand Down
1 change: 1 addition & 0 deletions unit/ability/ability.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ const (
Burrow
Resurrection
Hybrid
Camouflage
)
12 changes: 8 additions & 4 deletions unit/ability/ability_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion unit/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const (
Mole
SkeletonDemon
Butterfly
NinjaMasked
BlendMaster
Robot
MonkeyBoxer
)
12 changes: 6 additions & 6 deletions unit/type_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions unit/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var (
Mole: assets.MoleWalk_png,
SkeletonDemon: assets.SkeletonDemonWalk_png,
Butterfly: assets.ButterflyWalk_png,
NinjaMasked: assets.NinjaMaskedWalk_png,
BlendMaster: assets.BlendMasterWalk_png,
Robot: assets.RobotWalk_png,
MonkeyBoxer: assets.MonkeyBoxerWalk_png,
}
Expand All @@ -69,7 +69,7 @@ var (
Mole: assets.MoleFaceset_png,
SkeletonDemon: assets.SkeletonDemonFaceset_png,
Butterfly: assets.ButterflyFaceset_png,
NinjaMasked: assets.NinjaMaskedFaceset_png,
BlendMaster: assets.BlendMasterFaceset_png,
Robot: assets.RobotFaceset_png,
MonkeyBoxer: assets.MonkeyBoxerFaceset_png,
}
Expand Down

0 comments on commit 68313c1

Please sign in to comment.