Skip to content

Commit

Permalink
New Player Abilities (#169)
Browse files Browse the repository at this point in the history
* add ability cooldown component and system

* add components and bundles for standard weapon abilities and charge abilities

* add necessary data for each ability currently in the game for its own component, give player outgoing damage system the base stats

* remove old ability and weapon components and systems for player

* rename to abilities.rs

* add slot one and slot two ability type enums

* spawn slot 1 and 2 abilities as children of player entity

* move ability cooldown's to child ability entity

* reorganize player ui, currently an issue with armor counters not showing

* add new ui files

* fixed issue consumables not being collected by, removeing WeaponComponent from the player query

* add remaining ui

* add constants for player ui

* add constants for phase ui

* add constants for level ui

* remove unused imports

* create spawn armor counter ui function in trait

* add ability icons to ui assets, pass character information to player ui spawn functions

* add ability slots to ui assets

* add font to ui assets, use ui assets resource for spawning game ui instead of asset server

* add AbilityValueUi over the top of ability icon ui

* add system for updating abiltity charge value ui

* rename PlayerInputs for player abilities

* add event for activating abilities, add system for activating abilities

* add system for handling standard weapon abilities

* add start and update systems for charge ability

* add cooldown multiplier to PlayerOutgoingDamageComponent, add system to scale ability cooldowns based on money collected

* change names of tutorial to reflect ability slots

* remove unused imports

* add upgrades file

* remove pub use * in player/systems/mod.rs

* add structs for abilities that store minimum data in the ron abilities ron file

* add doc comments to player

* update text for collecting money and some juggernaut stats

* add border gradient

* adjust visibility of game ui, split player ui into three systems

* limit visibility of player systems

* remove copy from SpawnPosition

* fix spawn position usage

* move has_flipped_ui to implmentation

* move update cooldown to implementation

* remove unused code
  • Loading branch information
cdsupina authored Apr 18, 2024
1 parent 239c7e4 commit 037d126
Show file tree
Hide file tree
Showing 48 changed files with 1,829 additions and 1,108 deletions.
73 changes: 73 additions & 0 deletions assets/data/abilities.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
(
charge_ability: (
slot: Two,
base_cooldown_time: 0.8,
ability: (
action_time: 0.5,
incoming_damage_multiplier: 0.75,
impulse: 12000.0,
)
),
mega_blast_ability: (
slot: Two,
base_cooldown_time: 2.5,
ability: (
spread_pattern: Arc((
spread_weights: (0.5, 1.0),
max_spread: 1.57080,
projectile_gap: 3.14159,
)),
damage_multiplier: 5.0,
ammunition: Blast(Ally),
speed_multiplier: 2.0,
direction: 1.57080,
despawn_time_multiplier: 1.0,
size_multiplier: 5.0,
count_multiplier: 0.5,
sound: MegaBlastAbility,
),
),
standard_blast_ability: (
slot: One,
base_cooldown_time: 0.25,
ability: (
spread_pattern: Arc((
spread_weights: (0.5, 1.0),
max_spread: 1.57080,
projectile_gap: 3.14159,
)),
damage_multiplier: 1.0,
ammunition: Blast(Ally),
speed_multiplier: 1.0,
direction: 1.57080,
despawn_time_multiplier: 1.0,
size_multiplier: 1.0,
count_multiplier: 1.0,
sound: PlayerFireBlast,
),
),
standard_bullet_ability: (
slot: One,
base_cooldown_time: 0.3,
ability: (
spread_pattern: Random((
speed_range: (
start: 0.75,
end: 1.25,
),
angle_range: (
start: 1.37445,
end: 1.76715,
),
)),
damage_multiplier: 0.8,
ammunition: Bullet(Ally),
speed_multiplier: 1.0,
direction: 1.57080,
despawn_time_multiplier: 1.0,
size_multiplier: 1.0,
count_multiplier: 1.0,
sound: PlayerFireBlast,
),
),
)
71 changes: 20 additions & 51 deletions assets/data/characters.ron
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,21 @@
health: 80,
shields: 5,
shields_recharge_rate: 1.0,
collision_damage: 10,
attraction_distance: 150.0,
attraction_acceleration: 15.0,
money: 0,
collision_damage: 10,
weapon_damage: 12,
ability_period: 5.0,
ability_type: MegaBlast(5.0),
weapon: (
reload_time: 0.5,
initial_time: 0.5,
fire_mode: Manual,
capacity: 10,
projectile_data: (
ammunition: Blast(Ally),
damage: 10,
position: Local((0.0, 40.0)),
speed: 800.0,
direction: 1.57080,
despawn_time: 1.0,
count: 1,
spread_pattern: Arc((
spread_weights: (0.5, 1.0),
max_spread: 1.57080,
projectile_gap: 3.14159,
)),
size: 1.0,
sound: PlayerFireBlast,
),
),
projectile_speed: 800.0,
projectile_spawn_position: Local((0.0, 40.0)),
projectile_despawn_time: 1.0,
projectile_size: 1.0,
projectile_count: 1,
cooldown_multiplier: 2.0,
slot_1_ability: Some(StandardBlast),
slot_2_ability: Some(MegaBlast),
),
Juggernaut: (
acceleration: (25.0, 25.0),
Expand All @@ -49,39 +36,21 @@
health: 150,
shields: 10,
shields_recharge_rate: 0.75,
collision_damage: 15,
attraction_distance: 150.0,
attraction_acceleration: 15.0,
money: 0,
collision_damage: 15,
weapon_damage: 10,
ability_period: 2.0,
ability_type: Charge(0.5),
weapon: (
reload_time: 0.75,
initial_time: 0.75,
fire_mode: Manual,
capacity: 10,
projectile_data: (
ammunition: Bullet(Ally),
damage: 10,
position: Local((0.0, 45.0)),
speed: 650.0,
direction: 1.57080,
despawn_time: 0.4,
count: 2,
spread_pattern: Random((
speed_range: (
start: 0.75,
end: 1.25,
),
angle_range: (
start: 1.37445,
end: 1.76715,
),
)),
size: 1.0,
sound: PlayerFireBlast,
)
),
projectile_speed: 650.0,
projectile_spawn_position: Local((0.0, 45.0)),
projectile_despawn_time: 0.4,
projectile_size: 1.0,
projectile_count: 3,
cooldown_multiplier: 2.7,
slot_1_ability: Some(StandardBullet),
slot_2_ability: Some(Charge),
),
}
)
4 changes: 2 additions & 2 deletions assets/data/premade_levels.ron
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@
(
intro_text: Some("Destroy enemies and protect your ally using your basic attack"),
phase_type: Tutorial(
tutorial_lesson: Attack(
tutorial_lesson: AbilitySlotOne(
mobs_to_destroy: 3,
mobs_to_protect: 1,
spawn_range_x: (
Expand Down Expand Up @@ -820,7 +820,7 @@
(
intro_text: Some("Destroy enemies using your special ability"),
phase_type: Tutorial(
tutorial_lesson: Ability(
tutorial_lesson: AbilitySlotTwo(
mobs_to_destroy: 3,
spawn_range_x: (
start: -300.0,
Expand Down
4 changes: 2 additions & 2 deletions assets/data/text_effects.ron
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
scale: 0.4,
),
ConsumableCollected(Money1): (
text: "Fire Rate +",
text: "Cooldowns -",
text_color: Rgba(red: 0.0, green: 1.0, blue: 0.0, alpha: 1.0),
font_size: 60.0,
translation_x: (
Expand All @@ -28,7 +28,7 @@
scale: 0.4,
),
ConsumableCollected(Money3): (
text: "Fire Rate +++",
text: "Cooldowns ---",
text_color: Rgba(red: 0.0, green: 1.0, blue: 0.0, alpha: 1.0),
font_size: 60.0,
translation_x: (
Expand Down
7 changes: 7 additions & 0 deletions assets/ui_assets.assets.ron
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
rows: 2,
),
"thetawave_menu_button.image": File( path: "texture/menu_button_spritesheet.png"),
"ability_icon.mega_blast": File( path: "texture/megablast_ability.png"),
"ability_icon.charge": File( path: "texture/charge_ability.png"),
"ability_icon.standard_blast": File( path: "texture/blast_ability.png"),
"ability_icon.standard_bullet": File ( path: "texture/bullet_ability.png"),
"ability_slot.left": File ( path: "texture/ability_square_left.png"),
"ability_slot.right": File ( path: "texture/ability_square_right.png"),
"font.wibletown": File (path: "fonts/wibletown-regular.otf"),
"warning_gradient": File( path: "texture/warning_gradient.png"),
"defense_gradient": File( path: "texture/defense_gradient.png"),
})
Loading

0 comments on commit 037d126

Please sign in to comment.