Skip to content

Commit

Permalink
WIP ranged combat
Browse files Browse the repository at this point in the history
  • Loading branch information
Janiczek committed Oct 5, 2024
1 parent 66cac50 commit 986c396
Show file tree
Hide file tree
Showing 12 changed files with 5,170 additions and 2,026 deletions.
2 changes: 2 additions & 0 deletions .ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test: elm-test --compiler lamdera
watch: elm-test --compiler lamdera --watch
3 changes: 3 additions & 0 deletions src/Backend.elm
Original file line number Diff line number Diff line change
Expand Up @@ -1895,6 +1895,9 @@ oneTimePerkEffects currentTime =

Perk.NightVision ->
Nothing

Perk.BonusRangedDamage ->
Nothing
in
Perk.all
|> List.filterMap (\perk -> oneTimeEffect perk |> Maybe.map (Tuple.pair perk))
Expand Down
77 changes: 65 additions & 12 deletions src/Data/Enemy.elm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Data.Enemy exposing
, actionPoints
, addedSkillPercentages
, aimedShotName
, allTypes
, all
, criticalSpec
, damageResistanceNormal
, damageThresholdNormal
Expand All @@ -17,6 +17,7 @@ module Data.Enemy exposing
, forSmallChunk
, hp
, humanAimedShotName
, isLivingCreature
, manCriticalSpec
, meleeDamageBonus
, name
Expand Down Expand Up @@ -114,24 +115,24 @@ type Type
| Radscorpion


allTypes : List Type
allTypes =
[ Brahmin
all : List Type
all =
[ SilverGecko
, ToughSilverGecko
, GoldenGecko
, ToughGoldenGecko
, FireGecko
, ToughFireGecko
, Brahmin
, AngryBrahmin
, WeakBrahmin
, WildBrahmin
, GiantAnt
, ToughGiantAnt
, BlackRadscorpion
, LesserBlackRadscorpion
, LesserRadscorpion
, Radscorpion
, LesserBlackRadscorpion
, BlackRadscorpion
, SilverGecko
, ToughSilverGecko
, GoldenGecko
, ToughGoldenGecko
, FireGecko
, ToughFireGecko
]


Expand Down Expand Up @@ -3740,3 +3741,55 @@ dropItemsGenerator { items } =
)
|> Random.sequence
|> Random.map Maybe.values


isLivingCreature : Type -> Bool
isLivingCreature type_ =
case type_ of
SilverGecko ->
True

ToughSilverGecko ->
True

GoldenGecko ->
True

ToughGoldenGecko ->
True

FireGecko ->
True

ToughFireGecko ->
True

Brahmin ->
True

AngryBrahmin ->
True

WeakBrahmin ->
True

WildBrahmin ->
True

GiantAnt ->
True

ToughGiantAnt ->
True

BlackRadscorpion ->
True

LesserBlackRadscorpion ->
True

LesserRadscorpion ->
True

Radscorpion ->
True
11 changes: 11 additions & 0 deletions src/Data/Fight.elm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module Data.Fight exposing
, isCriticalAttack
, isMiss
, isNPC
, isOpponentLivingCreature
, isPlayer
, opponentName
, opponentXp
Expand Down Expand Up @@ -604,3 +605,13 @@ isMiss action =

_ ->
False


isOpponentLivingCreature : Opponent -> Bool
isOpponentLivingCreature opponent =
case opponent.type_ of
Npc enemy ->
Enemy.isLivingCreature enemy

Player _ ->
True
11 changes: 11 additions & 0 deletions src/Data/Fight/DamageType.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Data.Fight.DamageType exposing (DamageType(..))


type DamageType
= NormalDamage
| Fire
| Explosion
| Laser
| Plasma
| Electrical
| EMP
Loading

0 comments on commit 986c396

Please sign in to comment.