Commit Graph

72 Commits

Author SHA1 Message Date
Qustinnus
707fc287b4 Replaces intents with combat mode (#56601)
About The Pull Request

This PR removes intents and replaces them with a combat mode. An explanation of what this means can be found below
Major changes:

    Disarm and Grab intents have been removed.
    Harm/Help is now combat mode, toggled by F or 4 by default
    The context/verb/popup menu now only works when you do shift+right-click
    Right click is now disarm, both in and out of combat mode.
    Grabbing is now on ctrl-click.
    If you're in combat mode, and are currently grabbing/pulling someone, and ctrl-click somewhere else, it will not release the grab (To prevent misclicks)

Minor interaction changes:

Right click to dissasemble tables, racks, filing cabinets (When holding the right tool to do so)
Left click to stunbaton, right click to harmbaton
Right click to tip cows
Right click to malpractice surgery
Right click to hold people at gunpoint (if youre holding a gun)
Why It's Good For The Game

Intents heavily cripple both the code and the UI design of interactions. While I understand that a lot of people will dislike this PR as they are used to intents, they are one of our weakest links in terms of explaining to players how to do specific things, and require a lot more keypresses to do compared to this.

As an example, martial arts can now be done without having to juggle 1 2 3 and 4 to switch intents quickly.

As some of you who saw the first combat mode PR, the context menu used to be disabled in combat mode. In this version it is instead on shift-right click ensuring that you can always use it in the same way.

In this version, combat mode also no longer prevents you from attacking with items when you would so before, as this was something that was commonly complained about.

The full intention of this shift in control scheme is that right click will become "secondary interaction" for items, which prevents some of the awkward juggling we have now with item modes etcetera.
Changelog

cl Qustinnus
add: Intents have been replaced with a combat mode. For more info find the PR here: #56601
/cl
2021-02-04 16:37:32 +13:00
LemonInTheDark
dd6cea82d9 Reverts the recent config changes (#56606)
* Revert "Fixes included config files not loading (#56602)"

This reverts commit 0749b322f6.

* Revert "Adds configuration consistency tests (#56562)"

This reverts commit 4f44014e25.
2021-02-02 22:14:47 -05:00
Jordan Brown
4f44014e25 Adds configuration consistency tests (#56562)
Co-authored-by: Mothblocks <35135081+Jared-Fogle@users.noreply.github.com>
2021-02-02 13:22:52 -08:00
Timberpoes
1989497576 Frame stacking fix and unit test addition. (#56287)
* Reverts #56205

* Allow things without density to bypass checks

* The rest of the owl

* The rest of the owl

* Doc and tweak

* More feex

* RCD machine frame unit test

* I suck

* AAAAA

* Bad at unit tests

* Revert unit tests (for including in another PR)

* Fix windoor_assembly return logic

* Comment /mob/living/proc/PushAM logic

* Windoor assembley logic tweak

* Fix frame stacking

* Unit test

* Better wording from macros?
2021-01-22 21:18:05 +08:00
Timberpoes
a83c6aa4c0 Attempts to fix addictions being utterly broken and almost impossible to obtain. (#56302) 2021-01-21 13:16:49 -08:00
Donkie
e71e7cbbe2 Added a standardized json unit test results log and added my vscode test runner to recommendations (#56058)
Link to the test explorer: https://marketplace.visualstudio.com/items?itemName=Donkie.vscode-tgstation-test-adapter

The test explorer adapter lets you compile and run the code in one click of a button, with no messing about with defines necessary

The extension supports reading test results from the unit test logs, but its shitty having to parse logs for that, so this PR also adds support for a somewhat standardized method of logging unit test results to a json file instead.
2021-01-10 20:31:17 +00:00
Gamer025
73921636ad Add unit test for spawning simple_animals (#56021)
Simple unit test that allocates all mobs a gold slime could spawn
2021-01-08 22:59:46 -03:00
WarlockD
56345975ba The Great Radio Rework: NTNET Part 1 of many. (#54462)
Machinery networking refactor.
2020-12-30 21:54:34 +01:00
Qustinnus
f66ca34626 Refactors monkeys into a species (#55614)
Changes monkeys from carbon subtype to species.
2020-12-30 16:30:15 +01:00
interestingusernam3
0bc9ddf7ad Replaces US Indigenous People's Day with International Indigenous People's Day (#55458)
Title. This modifies a unit test that tested the holiday I'm removing to test mother's day instead, as International Indigenous People's Day isn't an nth week holiday.
2020-12-29 14:52:57 +13:00
Gamer025
c3bb60501f Add Designs Unit Test (#55760) 2020-12-28 12:33:06 -08:00
Jack LeCroy
23ee09967e Fix Hanukkah (again) and refactor Moth Week and Beer Day (#55532)
* Fix Hanukkah (again) and refactor Moth Week and Beer Day

* Remove unnecessary changes
2020-12-16 17:16:44 -08:00
Ghilker
d186c4f236 Temperature control unit (#55345)
This PR changes how freezers/heaters work by adding a button in the GUI that allow the users to switch between cooling and heating without the need to deconstruct the machine.
Circuitboards now will build the freezer and can't be changed by screwdriving the board.
Mapping isn't touched, all other functionalities are still there.
2020-12-13 07:16:53 +02:00
silicons
160175ee8b pass_flags handling refactor + rewrites a part of projectiles for the n-th time (#54924)
Yeah uhh this'll probably need testmerging even after it's done because yeah it's a bit big.
If y'all want me to atomize this into two PRs (pass flags vs projectiles) tell me please. Pass flags would have to go in first though, in that case, as new projectile hit handling will rely on pass_flags_self.
Pass flags:

Pass flags handling now uses an atom variable named pass_flags_self.
If any of these match a pass_flag on a thing trying to pass through, it's allowed through by default.
This makes overriding CanAllowThrough unnecessary for the majority of things. I've however not removed overrides for very.. weird cases, like plastic flaps which uses a prob(60) for letting PASSGLASS things through for god knows why.
LETPASSTHROW is now on pass_flags_self
Projectiles:

Not finalized yet, need to do something to make the system I have in mind have less unneeded overhead + snowflake

Basically, for piercing/phasing/otherwise projectiles that go through things instead of hitting the first dense object, I have them use pass_flags flags for two new variables, projectile_phasing and projectile_piercing. Anything with pass_flags_self in the former gets phased through entirely. Anything in the latter gets hit, and the projectile then goes through. on_hit will also register a piercing hit vs a normal hit (so things like missiles can only explode on a normal hit or otherwise, instead of exploding multiple times. Not needed as missiles qdel(src) right now but it's nice to have for the future).

I still need to decide what to do for hit handling proper, as Bump() is still preferred due to it not being as high-overhead as something like scanning on Moved(). I'm thinking I'll make Moved() only scan for cases where it needs to hit a non-dense object - a prone human the user clicked on, anything special like that. Don't know the exact specifics yet, which is why this is still WIP.

Projectiles now use check_pierce() to determine if it goes through something and hits it, doesn't hit it, or doesn't go through something at all (should delete self after hitting). Will likely make an on_pierce proc to be called post-piercing something so you can have !fun! things like projectiles that go down in damage after piercing something. This will likely deprecate the process_hit proc, or at least make it less awful.

scan_for_hit() is now used to attempt to hit something and will return whether the projectile got deleted or not. It will delete the projectile if the projectile does hit something and fails to pierce through it.

scan_moved_turf() (WIP) will be used for handling moving onto a turf.

permutated has been renamed to impacted. Ricocheting projectiles get it reset, allowing projectiles to pierce and potentially hit something again if it goes back around.

A new unit test has been added checking for projectiles with movement type of PHASING. This is because PHASING completely causes projectiles to break down as projectiles mainly sense collisions through Bump. The small boost in performance from using PHASING instead of having all pass flags active/overriding check_pierce is in my opinion not worth the extra snowflake in scan_moved_turf() I'd have to do to deal with having to check for hits manually rather than Bump()ing things.
Movement types

UNSTOPPABLE renamed to PHASING to better describe what it is, going through and crossing everything but not actually bumping.
Why It's Good For The Game

Better pass flags handling allows for less proc overrides, bitflag checks are far less expensive in general.

Fixes penetrating projectiles like sniper penetrators

This system also allows for better handling of piercing projectiles (see above) without too much snowflake code, as you'd only need to modify on_pierce() if you needed to do special handling like dampening damage per target pierced, and otherwise you could just use the standardized system and just set pass flags to what's needed. If you really need a projectile that pierces almost everything, override check_pierce(), which is still going to be easier than what was done before (even with snowflake handling of UNSTOPPABLE flag process_hit() was extremely ugly, now we don't rely on movement types at all.)
2020-12-10 09:29:27 +13:00
Jack LeCroy
f66b0452a2 Fix nth week holidays (#55364)
fix: Holidays appearing on the nth day of the month like Thanksgiving will work now.
tweak: Columbus day is now called Indigenous Peoples' Day.
2020-12-06 17:29:04 -08:00
Qustinnus
f887155b27 Kills oldfood, Puts newfood on top. (#55160)
Slays the last of old-food, making new-food the new normal.

Co-authored-by: MrMelbert <kmelbert4@gmail.com>
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
2020-12-04 00:11:47 -08:00
Jordan Brown
51ba68be76 Merge pull request #55268 from AutomaticFrenzy/patch/docs-from-github-wiki
Migrate some docs from the GitHub wiki into the repository
2020-12-03 11:17:06 -05:00
Tad Hardesty
126df37863 Make unit tests visible to linter and IDE (#55270) 2020-12-01 23:17:02 -05:00
Tad Hardesty
70e468b891 Merge branch 'master' of https://github.com/tgstation/tgstation into patch/docs-from-github-wiki 2020-11-30 21:25:43 -08:00
TiviPlus
de7994c0f7 Init sanity unit test (#55147)
https://github.com/tgstation/TerraGov-Marine-Corps/pull/5326
Stemming from 
https://github.com/ParadiseSS13/Paradise/pull/14770

Basically it just checks for bad initialize calls
2020-11-30 17:15:11 -05:00
TiviPlus
0eaab0bc54 Grep for space indentation (#54850)
#54604 atomizing
Since a lot of the space indents are in lists ill atomize those later
2020-11-30 12:48:40 -05:00
Tad Hardesty
8cc90f06ef Add Mothblocks's unit test documentation and guide 2020-11-29 22:46:38 -08:00
Ryll Ryll
5e878f504c Kills the quickswap shortcut (#55209) 2020-11-28 23:58:20 -08:00
Jared-Fogle
bee63ff37a Fixes incapacitating sleep test failure, general test touch ups. (#55196)
Fixes the random incapacitating sleep test failure
Tests now provide the option to use a custom turf, by default uses plasteel tiles instead of space
Tests now reserve turf instead of just using a corner in CentCom (which had unaccounted for tiles)
2020-11-28 07:36:02 -03:00
Arkatos1
ead0e859db Merge type variable fixes and unit test (#55173)
This PR fixes a case where certain materials caused issues when working with stacking machines, because they did not have set merge_type from the get go, which meant that initial() of that variable returned null.

To clarify further - if /obj/item/stack does not have set merge_type, it is generated merge_type upon Initialize(), which is the same as its typepath. For example, currently /obj/item/stack/sheet/bluespace_crystal does not have any merge_type set, and it is given merge_type = /obj/item/stack/sheet/bluespace_crystal upon Initialize(). Each Initialize(). Again and again.

There are quite a bit of these cases in the codebase, especially if its some older code. I have gone through them and set all of them their set merge_type, which they would inevitably receive anyway upon initializing and it fixes a bug mentioned above.

To prevent this happening again, I have also included unit test to check if merge types are set for stacks, included exceptions are usually abstract paths like /obj/item/stack/sheet/mineral, which contains zero behavior on its own and does not spawn unless done via admin tools.
2020-11-26 21:05:52 -05:00
ArcaneMusic
bf39caca6a Refactors Pastries into newfood. (#54996)
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
Co-authored-by: Floyd <Floydje123@hotmail.com>
2020-11-24 16:18:10 -08:00
Jared-Fogle
cf9ae02e39 Fixes #55112 - Swapping items no longer eats things (#55122)
Quick swapping items no longer hides them in the mobs contents
2020-11-24 14:54:01 -08:00
Qustinnus
41157f5d6b Moves grown food to newfood (#55040)
Moves grown food to newfood
Gives trash element support for callbacks for item creation override
2020-11-23 14:00:23 -08:00
Jared-Fogle
ac68b14018 Fix nearsighted glasses being able to be neutered with quick swap (#54916)
You can no longer quick swap another pair of glasses with nearsighted to see perfectly.

Currently you can:

    Choose nearsighted
    Quick swap to another pair of glasses
    See perfectly

This wasn't fixed by Shaps' changes since those call dropped, which do not run through unequip code.
I know one of you is abusing this, show yourself!
2020-11-22 09:54:02 -08:00
Jared-Fogle
2cec1acfbd Cache values in TEST_ASSERT_EQUAL and TEST_ASSERT_NOTEQUAL (#55074)
Previously if a comparison assertion failed, it would re-evaluate the a and b parameters, which could lead to confusing output if the values passed are not fixed or are impure.
2020-11-22 09:52:20 -08:00
EdgeLordExe
915204167d Unit tests for heretic knowledge (#55022) 2020-11-20 15:53:56 -08:00
NightRed
5be988ff9e Reverts metabolism on stomachs, keep them as important to eating (#54632) 2020-11-13 19:28:55 -08:00
Jared-Fogle
151dab8601 Test basic attacks along with the attack chain (#54769)
Tests shoving (as well as the knock down and dropping your item), harming (both with and without an item), and the attack chain.

I can think of a few cases in very recent memory that these have been broken (devil removal breaking melee damage, attack chain breaking due to something else).

Also adds `TRAIT_PERFECT_ATTACKER` which makes your punches always hit. This is currently only used for tests, as they are meant to be reliable.
2020-11-04 10:06:29 -05:00
MadMedicineMan
d29c75d1eb Canister max. pressure capacity display fix (#54600)
Atmos canisters now display their correct max. pressure capacity. Game code always expects kPa, code for SI-prefix-generation only expects the base unit (here: Pa), so the displayed value was always off by the factor 1000.
2020-10-26 12:23:54 -03:00
Jared-Fogle
7117ccaf68 Teleporter machinery now auto links with each other, removes screwdriver + wirecutter interaction (#54325)
Teleporter machinery will now automatically link with each other. This makes the screwdriver + wirecutter interaction redundant, so it has been removed.
2020-10-12 15:08:29 -03:00
NightRed
e9c47aa502 Unit tests for serving trays (#54224) 2020-10-07 15:33:44 -07:00
Jared-Fogle
75663a1c72 Undefine testing only define once tests are finished (#53960) 2020-09-26 09:10:00 -03:00
NightRed
6197be5bf3 Organ removal ends metabolizing reagents in the organ (#53619)
If an organ contains reagents it will end metabolizing them on removal.
2020-09-12 01:45:46 +01:00
Jared-Fogle
751328a2ba Fix chemicals not recognizing end of metabolization (#53550)
* Fix chemicals not recognizing end of metabolization

* Make generic to all organs
2020-09-11 09:41:42 -04:00
NightRed
0e5598ba5b Unit tests for expose_mob (#53498)
This is a set of unit tests for expose_mob.
This tests that INGEST, TOUCH, VAPOR, PATCH, INJECT are triggering on standard exposure methods.
2020-09-07 19:04:29 -03:00
Jared-Fogle
4c358cd25f Performing a head transplant will now properly preserve the appearance. (#53494) 2020-09-07 17:56:16 -03:00
NightRed
97d969dfca Many issue fixes for stomachs and chem interactions (#53440)
This changes the has_reagent check to work with stomachs.
Several supporting procs have been added to fully support this behavior.
end_metabolization will work as expected again
expose is working with INGEST items again
on_mob_add working as intended
on_mob_life has been reviewed and worked over.

Health Analyzers now show stomach contents, same with the medical kiosk.

Included the unit test to validate reagent checks.
Unit tests for the new procs on mob
2020-09-05 21:57:30 -03:00
Jared-Fogle
0fcf7d04a2 Add test for emotes (#53430) 2020-09-05 11:38:11 -03:00
Jared-Fogle
fc2cea5955 Fixes quick swapping suits creating illegal suit storage (#53272) 2020-09-01 05:03:25 -03:00
Jared-Fogle
09b9ad869e Change signature of BINARY_INSERT to require the full type path, add test (#53217)
BINARY_INSERT used to only take typepaths like/this. Now, it expects them to be /like/this, to be more consistent with ther est of the code.

Adds documentation to COMPTYPE.

Adds a test for BINARY_INSERT.
2020-09-01 04:40:52 -03:00
Jared-Fogle
4367f41b78 Fix resisting not starting stop, drop, and roll (#53079) 2020-08-20 23:57:03 -03:00
Jared-Fogle
9748709d1e Actually fix machine disassembly (#52871) 2020-08-14 12:37:40 +02:00
Jared-Fogle
7df16c595e Confusion will no longer continue to confuse after being cured (#52286)
* Confusion will no longer continue to confuse after being cured

* Grammar comment fix

* Move to status effect

* Remove test per request

* Make confusion a status effect, confusion curing now completely neuters the confusion

* set_confusion changes, get_confusion

* Fix confusion going down twice per tick

* Change strength = to proc

* Move procs to status_procs
2020-08-05 16:36:00 -03:00
Jared-Fogle
dd393b27e9 Fix multiple message prefixes being allowed at a time. AKA, you can now start messages with ellipses again. (#52498) 2020-07-26 22:07:41 -04:00
Ryll Ryll
9fc7865425 Adds unit tests for suffering Wounds (#52491)
* add wound tests

* comment

* clarify

* compromise
2020-07-26 13:38:56 -04:00