-
Notifications
You must be signed in to change notification settings - Fork 244
Расширение механики луков и добавление луков для сб #2474
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
Open
Firemixx
wants to merge
42
commits into
AdventureTimeSS14:master
Choose a base branch
from
Firemixx:CompoundBow
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
4dc2df2
CompoundBow
Firemixx ea026e9
аааа
Firemixx 56ded2e
fixs
Firemixx 5ee9f80
fix
Firemixx 297776b
fix: Мелкие правки
Firemixx c5d6110
fix
Firemixx ac0429a
фикс тестов..буэ
Firemixx 87158f4
еще фикс
Firemixx 7692786
aaaaaaaaaaaaaaaaaaaaaaaaaaa
Firemixx b973633
nullable developer
Firemixx 5be421b
уэ?
Firemixx 023c5c7
аааааааааааааааааааааааааааааааааа улучшение звуки и фиксы и нахер урон
Firemixx 92647dd
хули,пробуем
Firemixx b190899
еще раз пробуем
Firemixx 4f6c9a2
починка тупости
Firemixx 5f26340
fix
Firemixx 7664d53
aaaaaa
Firemixx c455da7
коммит для смены ветки
Firemixx 5bfcce1
add: Добавил луки, технологию, крафт и заготовки паков для стрел и луков
Firemixx 89b1b40
Merge branch 'master' into CompoundBow
Firemixx fbdb804
add: взрывные стрелы, стрелы светяшки, локализация, еще технология
Firemixx 7a94e9a
Merge branch 'CompoundBow' of https://github.com/Firemixx/Firemix_Rep…
Firemixx 52f5fbf
fix
Firemixx 2ea3ce6
fix2
Firemixx 264df20
fix: фикс рецептов
Firemixx 75fc88e
Merge branch 'master' into CompoundBow
Firemixx 31e04dc
Fix YAML syntax for Bombs/plastic.yml
Firemixx e91e100
Add ADTArrowGranade node to arrows.yml
Firemixx 975be00
Fix comment formatting for StepOfTension property
Firemixx b5a356c
Merge branch 'master' into CompoundBow
Firemixx a3872ed
Remove 'name' entry from arrows.yml
Firemixx cf76abb
fix
Firemixx 4c9e9c3
Merge branch 'CompoundBow' of https://github.com/Firemixx/Firemix_Rep…
Firemixx 9829842
fix of brain
Firemixx a4f2ba0
fix
Firemixx 6978660
Update arsenal.yml
Firemixx 1952d7a
Merge branch 'master' into CompoundBow
Firemixx d468d8a
Merge branch 'master' into CompoundBow
Firemixx bebc614
малые фиксы
Firemixx 1eb9f9c
Merge branch 'master' into CompoundBow
Firemixx e6a8000
Merge branch 'master' into CompoundBow
Firemixx 0ae4173
Merge branch 'master' into CompoundBow
Darkiich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| using Content.Shared.ADT.BowsSystem.Components; | ||
| using Content.Shared.Weapons.Ranged.Events; | ||
| using Content.Shared.Weapons.Ranged.Systems; | ||
|
|
||
| namespace Content.Server.ADT.BowsSystem; | ||
|
|
||
| public sealed partial class BowsSystem : EntitySystem | ||
| { | ||
| public override void Initialize() | ||
| { | ||
| base.Initialize(); | ||
|
|
||
| SubscribeLocalEvent<ExpendedBowsComponent, ShotAttemptedEvent>(OnShootAttempt); | ||
| } | ||
|
|
||
| public void OnShootAttempt(Entity<ExpendedBowsComponent> bow,ref ShotAttemptedEvent args) | ||
| { | ||
| if(bow.Comp.StepOfTension==0) | ||
| args.Cancel(); | ||
| } | ||
| } | ||
63 changes: 63 additions & 0 deletions
63
Content.Shared/ADT/BowsSystem/Components/ExpendedBowsComponent.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| using Robust.Shared.Audio; | ||
| using Robust.Shared.GameStates; | ||
|
|
||
| namespace Content.Shared.ADT.BowsSystem.Components; | ||
| [RegisterComponent, NetworkedComponent] | ||
| public sealed partial class ExpendedBowsComponent : Component | ||
| { | ||
|
|
||
| /// <summary> | ||
| /// Sound to bow on tension | ||
| /// </summary> | ||
| [DataField, ViewVariables(VVAccess.ReadWrite)] | ||
| public SoundSpecifier bowSound = new SoundPathSpecifier("/Audio/Weapons/Guns/Misc/arrow_nock.ogg"); | ||
|
|
||
| /// <summary> | ||
| /// Zero state timer | ||
| /// </summary> | ||
| [DataField, ViewVariables(VVAccess.ReadWrite)] | ||
| public TimeSpan coldownStart = TimeSpan.Zero; | ||
|
|
||
| /// <summary> | ||
| /// Time to timer | ||
| /// </summary> | ||
| [DataField, ViewVariables(VVAccess.ReadWrite)] | ||
| public float floatToColdown = 7f; | ||
|
|
||
| /// <summary> | ||
| /// Step of tension in bow | ||
| /// </summary> | ||
| public int StepOfTension=0; | ||
Firemixx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /// <summary> | ||
| /// Tension and loc for it | ||
| /// </summary> | ||
| public Dictionary<int, string> TensionAndLoc = new Dictionary<int, string> | ||
| { | ||
| {0, "popup-bow-use-null"}, | ||
| {1, "popup-bow-use-light"}, | ||
| {2, "popup-bow-use-medium"}, | ||
| {3, "popup-bow-use-hard"}, | ||
| }; | ||
|
|
||
| /// <summary> | ||
| /// Tension in bow and speed modiefer for arrow | ||
| /// </summary> | ||
| public Dictionary<int, float> TensionAndModieferSpeed = new Dictionary<int, float> | ||
| { | ||
| {0, 0.5f}, | ||
| {1, 1f}, | ||
| {2, 1.4f}, | ||
| {3, 3f}, | ||
| }; | ||
|
|
||
| /// <summary> | ||
| /// Max tension in bow | ||
| /// </summary> | ||
| public int MaxTension = 3; | ||
|
|
||
| /// <summary> | ||
| /// Min tension in bow | ||
| /// </summary> | ||
| public int MinTension = 0; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| using Content.Shared.ADT.BowsSystem.Components; | ||
| using Content.Shared.Containers.ItemSlots; | ||
| using Content.Shared.Interaction.Events; | ||
| using Content.Shared.Projectiles; | ||
| using Content.Shared.Popups; | ||
| using Content.Shared.Weapons.Ranged.Components; | ||
| using Content.Shared.Weapons.Ranged.Events; | ||
| using Content.Shared.Weapons.Ranged.Systems; | ||
| using Content.Shared.Wieldable.Components; | ||
| using Robust.Shared.Audio; | ||
| using Robust.Shared.Audio.Systems; | ||
| using Robust.Shared.Containers; | ||
| using Robust.Shared.Timing; | ||
|
|
||
| namespace Content.Shared.ADT.BowsSystem; | ||
|
|
||
| public sealed partial class BowsSystem : EntitySystem | ||
| { | ||
| [Dependency] private readonly SharedContainerSystem _containerSystem = default!; | ||
| [Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!; | ||
| [Dependency] private readonly IGameTiming _timing = default!; | ||
| [Dependency] private readonly SharedAudioSystem _audio = default!; | ||
| [Dependency] private readonly SharedPopupSystem _popup = default!; | ||
| public override void Initialize() | ||
| { | ||
| base.Initialize(); | ||
| SubscribeLocalEvent<ExpendedBowsComponent, GunShotEvent>(OnShoot); | ||
| SubscribeLocalEvent<ExpendedBowsComponent, UseInHandEvent>(OnUseInHand); | ||
| SubscribeLocalEvent<ExpendedBowsComponent, GunRefreshModifiersEvent>(EditSpeed); | ||
| } | ||
|
|
||
| private void OnShoot(Entity<ExpendedBowsComponent> bow, ref GunShotEvent args) | ||
| { | ||
| bow.Comp.StepOfTension=bow.Comp.MinTension; | ||
| } | ||
|
|
||
| private void OnUseInHand(Entity<ExpendedBowsComponent> bow, ref UseInHandEvent args) | ||
| { | ||
| bow.Comp.coldownStart = _timing.CurTime + TimeSpan.FromSeconds(bow.Comp.floatToColdown); | ||
| } | ||
|
|
||
| public override void Update(float frameTime) | ||
| { | ||
| base.Update(frameTime); | ||
|
|
||
| var query = EntityQueryEnumerator<ExpendedBowsComponent>(); | ||
|
|
||
| while (query.MoveNext(out var uid, out var comp)) | ||
| { | ||
| if (_timing.CurTime < comp.coldownStart) | ||
| continue; | ||
| if(!TryComp<WieldableComponent>(uid,out var wieldedcomp)) | ||
| continue; | ||
| if (wieldedcomp.Wielded == false) | ||
| { | ||
| comp.StepOfTension=comp.MinTension; | ||
| continue; | ||
| } | ||
| if (wieldedcomp.User is not {} owner) | ||
| continue; | ||
| if (comp.StepOfTension >= comp.MaxTension) | ||
| continue; | ||
|
|
||
| comp.StepOfTension++; | ||
| _popup.PopupClient(Loc.GetString(comp.TensionAndLoc[comp.StepOfTension],("user", owner)), uid, owner); | ||
| _audio.PlayPvs(comp.bowSound, owner); | ||
| comp.coldownStart = _timing.CurTime + TimeSpan.FromSeconds(comp.floatToColdown); | ||
| } | ||
| } | ||
Firemixx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| private void EditSpeed(Entity<ExpendedBowsComponent> bow, ref GunRefreshModifiersEvent args) | ||
| { | ||
| args.ProjectileSpeed =args.ProjectileSpeed * bow.Comp.TensionAndModieferSpeed[bow.Comp.StepOfTension]; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
Resources/Locale/ru-RU/ADT/bowsexpended/popups-bows-expended.ftl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| popup-bow-use-null = {$user} отпускает тетиву! | ||
| popup-bow-use-light = {$user} начинает натягивать тетиву! | ||
| popup-bow-use-medium = {$user} натягивает тетиву сильнее! | ||
| popup-bow-use-hard = {$user} натягивает тетиву максимально! |
5 changes: 5 additions & 0 deletions
5
Resources/Locale/ru-RU/ADT/prototypes/Entities/Objects/Weapons/Guns/Bows/compound_bows.ftl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ent-ADTHandMadeCompoundBow = блочный лук | ||
| .desc = Ты бы еще еоку скрафтил бы! | ||
|
|
||
| ent-ADTSecurityCompoundBow = блочный лук службы безопасности | ||
| .desc = Ты вспоминаешь, как по новостям везде крутили одну фразу инженеров программы арсенала станций: "Ну в СССП, в древние времена, была же конское СБ, вот и у нас будет!...Лучники СБ..." |
8 changes: 8 additions & 0 deletions
8
Resources/Locale/ru-RU/ADT/prototypes/Entities/Objects/Weapons/Guns/Projectiles/arrows.ftl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| ent-ADTArrowSecurity = стрела службы безопасности | ||
| .desc = Металлическая, грациозная и идеальная! Самое то, чтобы применить её на клоуне! | ||
|
|
||
| ent-ADTArrowFlashSecurity = светящаяся стрела | ||
| .desc = Два в одном! Только сейчас! Пометь цель для ловли стрелой, и оставь тем самым на ней как ментальный, так и физический урон! | ||
|
|
||
| ent-ADTArrowGranade = взрывная стрела | ||
| .desc = "Идиальный" снаряд для вашего лука во время стелса! Разорвет всех, кто вас может заметить, услышать или каким либо способом еще обнаружить. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
Resources/Prototypes/ADT/Entities/Objects/Weapons/Guns/Bows/compound_bows.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| - type: entity | ||
| id: ADTHandMadeCompoundBow | ||
| parent: BaseBow | ||
| components: | ||
| - type: Sprite | ||
| sprite: ADT/Objects/Weapons/Guns/Bow/compound_bow_handmade.rsi | ||
| layers: | ||
| - state: unwielded | ||
| map: [ base ] | ||
| - state: unwielded-arrow | ||
| map: [ arrow ] | ||
| visible: false | ||
| - type: Appearance | ||
| - type: ItemMapper | ||
| spriteLayers: | ||
| - arrow | ||
| mapLayers: | ||
| arrow: | ||
| whitelist: | ||
| tags: | ||
| - Arrow | ||
| - type: GenericVisualizer | ||
| visuals: | ||
| enum.WieldableVisuals.Wielded: | ||
| arrow: | ||
| True: { state: wielded-arrow } | ||
| False: { state: unwielded-arrow } | ||
| base: | ||
| True: { state: wielded } | ||
| False: { state: unwielded } | ||
| - type: ExpendedBows | ||
| floatToColdown: 5 | ||
| - type: Construction | ||
| graph: HandmadeCompoundBow | ||
| node: HandmadeCompoundBow | ||
|
|
||
| - type: entity | ||
| id: ADTSecurityCompoundBow | ||
| parent: BaseBow | ||
| components: | ||
| - type: Sprite | ||
| sprite: ADT/Objects/Weapons/Guns/Bow/compound_bow_security.rsi | ||
| layers: | ||
| - state: unwielded | ||
| map: [ base ] | ||
| - state: unwielded-arrow | ||
| map: [ arrow ] | ||
| visible: false | ||
| - type: Appearance | ||
| - type: ItemMapper | ||
| spriteLayers: | ||
| - arrow | ||
| mapLayers: | ||
| arrow: | ||
| whitelist: | ||
| tags: | ||
| - Arrow | ||
| - type: GenericVisualizer | ||
| visuals: | ||
| enum.WieldableVisuals.Wielded: | ||
| arrow: | ||
| True: { state: wielded-arrow } | ||
| False: { state: unwielded-arrow } | ||
| base: | ||
| True: { state: wielded } | ||
| False: { state: unwielded } | ||
| - type: ExpendedBows | ||
| floatToColdown: 2 | ||
| - type: AttachableHolder | ||
| slots: | ||
| rmc-aslot-rail: | ||
| whitelist: | ||
| tags: | ||
| - ADTAttachmentT2Miniscope | ||
| - type: AttachableHolderVisuals | ||
| offsets: | ||
| rmc-aslot-rail: -0.0325, -0.0625 |
79 changes: 79 additions & 0 deletions
79
Resources/Prototypes/ADT/Entities/Objects/Weapons/Guns/Projectiles/arrows.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| - type: entity | ||
| parent: BaseArrow | ||
| id: ADTArrowSecurity | ||
| components: | ||
| - type: Sprite | ||
| sprite: Objects/Weapons/Guns/Projectiles/arrows.rsi | ||
| layers: | ||
| - state: tail | ||
| color: red | ||
| - state: rod | ||
| color: white | ||
| - state: tip | ||
| color: white | ||
| - state: solution1 | ||
| map: ["enum.SolutionContainerLayers.Fill"] | ||
| visible: false | ||
| - type: Projectile | ||
| damage: | ||
| types: | ||
| Piercing: 35 | ||
|
|
||
| - type: entity | ||
| parent: BaseArrow | ||
| id: ADTArrowFlashSecurity | ||
| components: | ||
| - type: Sprite | ||
| sprite: Objects/Weapons/Guns/Projectiles/arrows.rsi | ||
| layers: | ||
| - state: tail | ||
| color: yellow | ||
| - state: rod | ||
| color: white | ||
| - state: tip | ||
| color: white | ||
| - state: solution1 | ||
| map: ["enum.SolutionContainerLayers.Fill"] | ||
| visible: false | ||
| - type: Projectile | ||
| damage: | ||
| types: | ||
| Piercing: 20 | ||
| Heat: 5 | ||
| - type: AmbientSound | ||
| enabled: true | ||
| volume: 0 | ||
| range: 7 | ||
| sound: | ||
| path: /Audio/Machines/sonar-ping.ogg | ||
| params: | ||
| loop: true | ||
| - type: IgniteOnCollide | ||
| fireStacks: 1 | ||
| - type: PointLight | ||
| enabled: true | ||
| color: "#ffee00" | ||
| radius: 15.0 | ||
| energy: 9.0 | ||
|
|
||
| - type: entity | ||
| parent: BaseArrow | ||
| id: ADTArrowGranade | ||
| components: | ||
| - type: TriggerOnCollide | ||
| fixtureID: fix1 | ||
| maxTriggers: 1 | ||
| - type: Sprite | ||
| sprite: ADT/Objects/Weapons/Guns/Projectiles/arrows_custom.rsi | ||
| layers: | ||
| - state: grenade | ||
| - type: ExplodeOnTrigger | ||
| - type: Explosive | ||
| explosionType: DemolitionCharge | ||
| totalIntensity: 150 | ||
| intensitySlope: 25 | ||
| maxIntensity: 50 | ||
| canCreateVacuum: false | ||
| - type: Construction | ||
| graph: ADTArrowGranade | ||
| node: ADTArrowGranade |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.