-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into nomorecorvax
- Loading branch information
Showing
23 changed files
with
1,092 additions
and
12 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
Content.Server/ADT/SizeAttribute/SizeAttributeComponent.cs
This file contains 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,14 @@ | ||
using Content.Shared.Cloning; | ||
|
||
namespace Content.Server.ADT.SizeAttribute | ||
{ | ||
[RegisterComponent] | ||
public sealed partial class SizeAttributeComponent : Component, ITransferredByCloning | ||
{ | ||
[DataField("short")] | ||
public bool Short = false; | ||
|
||
[DataField("tall")] | ||
public bool Tall = false; | ||
} | ||
} |
This file contains 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,94 @@ | ||
using System.Numerics; | ||
using Robust.Server.GameObjects; | ||
using Robust.Shared.Physics; | ||
using Robust.Shared.Physics.Collision.Shapes; | ||
using Robust.Shared.Physics.Systems; | ||
using Content.Shared.Item.PseudoItem; | ||
|
||
namespace Content.Server.ADT.SizeAttribute | ||
{ | ||
public sealed class SizeAttributeSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IEntityManager _entityManager = default!; | ||
[Dependency] private readonly SharedPhysicsSystem _physics = default!; | ||
[Dependency] private readonly AppearanceSystem _appearance = default!; | ||
[Dependency] private readonly FixtureSystem _fixtures = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<SizeAttributeComponent, ComponentInit>(OnComponentInit); | ||
} | ||
|
||
private void OnComponentInit(EntityUid uid, SizeAttributeComponent component, ComponentInit args) | ||
{ | ||
if (!TryComp<SizeAttributeWhitelistComponent>(uid, out var whitelist)) | ||
return; | ||
|
||
if (whitelist.Tall && component.Tall) | ||
{ | ||
Scale(uid, component, whitelist.TallScale, whitelist.TallDensity, whitelist.TallCosmeticOnly); | ||
PseudoItem(uid, component, whitelist.TallPseudoItem); | ||
} | ||
else if (whitelist.Short && component.Short) | ||
{ | ||
Scale(uid, component, whitelist.ShortScale, whitelist.ShortDensity, whitelist.ShortCosmeticOnly); | ||
PseudoItem(uid, component, whitelist.ShortPseudoItem); | ||
} | ||
} | ||
|
||
private void PseudoItem(EntityUid uid, SizeAttributeComponent component, bool active) | ||
{ | ||
if (active) | ||
{ | ||
if (TryComp<PseudoItemComponent>(uid, out var pseudoI)) | ||
return; | ||
|
||
_entityManager.AddComponent<PseudoItemComponent>(uid); | ||
} | ||
else | ||
{ | ||
if (!TryComp<PseudoItemComponent>(uid, out var pseudoI)) | ||
return; | ||
|
||
_entityManager.RemoveComponent<PseudoItemComponent>(uid); | ||
} | ||
} | ||
|
||
private void Scale(EntityUid uid, SizeAttributeComponent component, float scale, float density, bool cosmeticOnly) | ||
{ | ||
if (scale <= 0f && density <= 0f) | ||
return; | ||
|
||
_entityManager.EnsureComponent<ScaleVisualsComponent>(uid); | ||
|
||
var appearanceComponent = _entityManager.EnsureComponent<AppearanceComponent>(uid); | ||
if (!_appearance.TryGetData<Vector2>(uid, ScaleVisuals.Scale, out var oldScale, appearanceComponent)) | ||
oldScale = Vector2.One; | ||
|
||
_appearance.SetData(uid, ScaleVisuals.Scale, oldScale * scale, appearanceComponent); | ||
|
||
if (!cosmeticOnly && _entityManager.TryGetComponent(uid, out FixturesComponent? manager)) | ||
{ | ||
foreach (var (id, fixture) in manager.Fixtures) | ||
{ | ||
if (!fixture.Hard || fixture.Density <= 1f) | ||
continue; // This will skip the flammable fixture and any other fixture that is not supposed to contribute to mass | ||
|
||
switch (fixture.Shape) | ||
{ | ||
case PhysShapeCircle circle: | ||
_physics.SetPositionRadius(uid, id, fixture, circle, circle.Position * scale, circle.Radius * scale, manager); | ||
break; | ||
default: | ||
throw new NotImplementedException(); | ||
} | ||
|
||
_physics.SetDensity(uid, id, fixture, density); | ||
} | ||
} | ||
} | ||
} | ||
|
||
[ByRefEvent] | ||
public readonly record struct ScaleEntityEvent(EntityUid Uid) { } | ||
} |
2 changes: 1 addition & 1 deletion
2
Content.Server/ADT/SizeAttribute/SizeAttributeWhitelistComponent.cs
This file contains 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 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 @@ | ||
namespace Content.Shared.Cloning; | ||
|
||
/// <summary> | ||
/// Indicates that this Component should be transferred to the new entity when the entity is cloned (for example, using a cloner) | ||
/// </summary> | ||
public interface ITransferredByCloning | ||
{ | ||
} |
This file contains 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,19 @@ | ||
using Content.Shared.Cloning; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; | ||
|
||
namespace Content.Shared.Item.PseudoItem; | ||
/// <summary> | ||
/// For entities that behave like an item under certain conditions, | ||
/// but not under most conditions. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class PseudoItemComponent : Component, ITransferredByCloning | ||
{ | ||
[DataField("size", customTypeSerializer: typeof(PrototypeIdSerializer<ItemSizePrototype>))] | ||
public string Size = "Huge"; | ||
|
||
public bool Active = false; | ||
|
||
[DataField] | ||
public EntityUid? SleepAction; | ||
} |
This file contains 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,2 @@ | ||
ent-OrganKoboltStomach = { ent-OrganAnimalStomach } | ||
.desc = { ent-OrganAnimalStomach.desc } |
22 changes: 22 additions & 0 deletions
22
Resources/Locale/ru-RU/ADT/prototypes/Body/Parts/kobalt.ftl
This file contains 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,22 @@ | ||
ent-PartKobolt = часть тела кобольда | ||
.desc = { ent-BaseItem.desc } | ||
ent-TorsoKobolt = торс кобольда | ||
.desc = { ent-PartKobolt.desc } | ||
ent-HeadKobolt = голова кобольда | ||
.desc = { ent-PartKobolt.desc } | ||
ent-LeftArmKobolt = левая рука кобольда | ||
.desc = { ent-PartKobolt.desc } | ||
ent-RightArmKobolt = правая рука кобольда | ||
.desc = { ent-PartKobolt.desc } | ||
ent-LeftHandKobolt = левая кисть кобольда | ||
.desc = { ent-PartKobolt.desc } | ||
ent-RightHandKobolt = правая кисть кобольда | ||
.desc = { ent-PartKobolt.desc } | ||
ent-LeftLegKobolt = левая нога кобольда | ||
.desc = { ent-PartKobolt.desc } | ||
ent-RightLegKobolt = правая нога кобольда | ||
.desc = { ent-PartKobolt.desc } | ||
ent-LeftFootKobolt = левая стопа кобольда | ||
.desc = { ent-PartKobolt.desc } | ||
ent-RightFootKobolt = правая стопа кобольда | ||
.desc = { ent-PartKobolt.desc } |
77 changes: 77 additions & 0 deletions
77
Resources/Locale/ru-RU/ADT/prototypes/Entities/Mobs/Customization/Markings/kobalt.ftl
This file contains 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 @@ | ||
marking-KoboltFrillsShort-frills_short = Кобольд, воротник (Короткий) | ||
marking-KoboltFrillsShort = Кобольд, воротник (Короткий) | ||
marking-KoboltFrillsSimple-frills_simple = Кобольд, воротник (Простой) | ||
marking-KoboltFrillsSimple = Кобольд, воротник (Простой) | ||
marking-KoboltFrillsAquatic-frills_aquatic = Кобольд, воротник (Водный) | ||
marking-KoboltFrillsAquatic = Кобольд, воротник (Водный) | ||
marking-KoboltHornsAngler-horns_angler = Кобольд, рожки (Рыболов) | ||
marking-KoboltHornsAngler = Кобольд, рожки (Рыболов) | ||
marking-KoboltHornsCurled-horns_curled = Кобольд, рожки (Завитые) | ||
marking-KoboltHornsCurled = Кобольд, рожки (Завитые) | ||
marking-KoboltHornsRam-horns_ram = Кобольд, рожки (Бараньи) | ||
marking-KoboltHornsRam = Кобольд, рожки (Бараньи) | ||
marking-KoboltHornsShort-horns_short = Кобольд, рожки (Короткие) | ||
marking-KoboltHornsShort = Кобольд, рожки (Короткие) | ||
marking-KoboltHornsSimple-horns_simple = Кобольд, рожки | ||
marking-KoboltHornsSimple = Кобольд, рожки | ||
marking-KoboltTailSmooth-tail_smooth_primary = Кобольд, хвост | ||
marking-KoboltTailSmooth-tail_smooth_secondary = Оттенок | ||
marking-KoboltTailSmooth = Кобольд, хвост (Гладкий) | ||
marking-KoboltTailLarge-tail_large = Кобольд, хвост (Большой) | ||
marking-KoboltTailLarge = Кобольд, хвост (Большой) | ||
marking-KoboltTailSpikes-tail_spikes = Кобольд, хвост (Шипастый) | ||
marking-KoboltTailSpikes = Кобольд, хвост (Шипастый) | ||
marking-KoboltTailLTiger-tail_ltiger = Кобольд, хвост (Светлые тигриные полоски) | ||
marking-KoboltTailLTiger = Кобольд, хвост (Светлые тигриные полоски) | ||
marking-KoboltTailDTiger-tail_dtiger = Кобольд, хвост (Тёмные тигриные полоски) | ||
marking-KoboltTailDTiger = Кобольд, хвост (Тёмные тигриные полоски) | ||
marking-KoboltSnoutRound-snout_round = Кобольд, морда (Круглая) | ||
marking-KoboltSnoutRound = Кобольд, морда (Круглая) | ||
marking-KoboltSnoutSharp-snout_sharp = Кобольд, морда (Заострёная) | ||
marking-KoboltSnoutSharp = Кобольд, морда (Заострёная) | ||
marking-KoboltChestTiger-body_tiger = Кобольд, грудь (Тигр) | ||
marking-KoboltChestTiger = Кобольд, грудь (Тигр) | ||
marking-KoboltHeadTiger-head_tiger = Кобольд, голова (Тигр) | ||
marking-KoboltHeadTiger = Кобольд, голова (Тигр) | ||
marking-KoboltLArmTiger-l_arm_tiger = Кобольд, левая рука (Тигр) | ||
marking-KoboltLArmTiger = Кобольд, левая рука (Тигр) | ||
marking-KoboltLLegTiger-l_leg_tiger = Кобольд, левая нога (Тигр) | ||
marking-KoboltLLegTiger = Кобольд, левая нога (Тигр) | ||
marking-KoboltRArmTiger-r_arm_tiger = Кобольд, правая рука (Тигр) | ||
marking-KoboltRArmTiger = Кобольд, правая рука (Тигр) | ||
marking-KoboltRLegTiger-r_leg_tiger = Кобольд, правая нога (Тигр) | ||
marking-KoboltRLegTiger = Кобольд, правая нога (Тигр) | ||
marking-KoboltFrillsDivinity-frills_divinity = Кобольд, воротник (Божественный) | ||
marking-KoboltFrillsDivinity = Кобольд, воротник (Божественный) | ||
marking-KoboltFrillsBig-frills_big = Кобольд, воротник (Большой) | ||
marking-KoboltFrillsBig = Кобольд, воротник (Большой) | ||
marking-KoboltFrillsNeckfull-frills_neckfull = Кобольд, воротник (Полношейный) | ||
marking-KoboltFrillsNeckfull = Кобольд, воротник (Полношейный) | ||
marking-KoboltHornsDouble-horns_double = Кобольд, рожки (Двойные) | ||
marking-KoboltHornsDouble = Кобольд, рожки (Двойные) | ||
marking-KoboltFrillsAxolotl-frills_axolotl = Кобольд, воротник (Аксолотль) | ||
marking-KoboltFrillsHood-frills_hood_primary = Внешний капюшон | ||
marking-KoboltFrillsHood-frills_hood_secondary = Внутренний капюшона | ||
marking-KoboltFrillsAxolotl = Кобольд, воротник (Аксолотль) | ||
marking-KoboltFrillsHood = Кобольд, воротник (Капюшон) | ||
marking-KoboltHornsArgali-horns_argali = Кобольд, рожки (Аргали) | ||
marking-KoboltHornsArgali = Кобольд, рожки (Аргали) | ||
marking-KoboltHornsAyrshire-horns_ayrshire = Кобольд, рожки (Айршир) | ||
marking-KoboltHornsAyrshire = Кобольд, рожки (Айршир) | ||
marking-KoboltHornsMyrsore-horns_myrsore = Кобольд, рожки (Мирзора) | ||
marking-KoboltHornsMyrsore = Кобольд, рожки (Мирзора) | ||
marking-KoboltHornsBighorn-horns_bighorn = Кобольд, рожки (Толсторог) | ||
marking-KoboltHornsBighorn = Кобольд, рожки (Толсторог) | ||
marking-KoboltHornsDemonic-horns_demonic = Кобольд, рожки (Демонические) | ||
marking-KoboltHornsDemonic = Кобольд, рожки (Демонические) | ||
marking-KoboltHornsKoboldEars-horns_kobold_ears = Кобольд, уши (Кобольд) | ||
marking-KoboltHornsKoboldEars = Кобольд, уши (Кобольд) | ||
marking-KoboltHornsFloppyKoboldEars-horns_floppy_kobold_ears = Кобольд, уши (Вислоухий кобольд) | ||
marking-KoboltHornsFloppyKoboldEars = Кобольд, уши (Вислоухий кобольд) | ||
marking-KoboltChestUnderbelly-body_underbelly = Кобольд, грудь (Подбрюшье) | ||
marking-KoboltChestUnderbelly = Кобольд, грудь (Подбрюшье) | ||
marking-KoboltChestBackspikes-body_backspikes = Кобольд, грудь, шипы на спине (Четыре) | ||
marking-KoboltChestBackspikes = Кобольд, грудь, шипы на спине (Четыре) | ||
marking-KoboltSnoutSplotch = Кобольд, морда лица (Пятно) | ||
marking-KoboltSnoutSplotch-snout_splotch_primary = Морда | ||
marking-KoboltSnoutSplotch-snout_splotch_secondary = Нос |
2 changes: 2 additions & 0 deletions
2
Resources/Locale/ru-RU/ADT/prototypes/Entities/Mobs/Player/kobalt.ftl
This file contains 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,2 @@ | ||
ent-MobKobolt = Урист МакКобольд | ||
.desc = { ent-BaseMobKobolt.desc } |
5 changes: 5 additions & 0 deletions
5
Resources/Locale/ru-RU/ADT/prototypes/Entities/Mobs/Species/kobalt.ftl
This file contains 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-BaseMobKobolt = Урист Мак | ||
.desc = { ent-BaseMobSpeciesOrganic.desc } | ||
.suffix = Кобольд | ||
ent-MobKoboltDummy = { ent-BaseSpeciesDummy } | ||
.desc = { ent-BaseSpeciesDummy.desc } |
This file contains 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 @@ | ||
trait-category-height = Рост |
This file contains 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 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 @@ | ||
- type: entity | ||
id: OrganKoboltStomach | ||
parent: OrganReptilianStomach | ||
noSpawn: true |
Oops, something went wrong.