Skip to content
This repository was archived by the owner on Apr 14, 2020. It is now read-only.

Refactor/destroy genclosestammo cache class #1212

Open
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

MadaraUchiha
Copy link
Contributor

Additions

N/A

Changes

Refactors turret reload mechanics

Breaking Changes:

  • Reloading turrets directly from inventory is not possible anymore. Players need to make the pawn drop from inventory first.
    This behavior is consistent with vanilla refueling.

References

Todo: Open issue.

Reasoning

Removing the GenClosestAmmo class as suggested by maintainers on #1209.

Alternatives

N/A

Testing

Check tests you have performed:

  • Compiles without warnings
  • Game runs without errors
  • (For compatibility patches) ...with and without patched mod loaded
  • Playtested a colony (specify how long)

@mitasamodel
Copy link

Hello! Thanks for working on it!
I'm trying to test it in my game and the issue seems to be here =(
One question. Is it compiled already? The update date for "Assemblies" directory and "Source" directory is not the same. Unfortunately I cannot compile it by myself.

Thanks,
Dmitrii

@MadaraUchiha
Copy link
Contributor Author

@mitasamodel It is not compiled yet. In fact, I am not sure it even compiles! This PR is very much WIP, it's not yet playable.

My other PR #1209 makes an attempt to fix this issue and makes things better but not perfect. You can give that one a try and see if that one works as a crutch until this one is ready :)

@mitasamodel
Copy link

@MadaraUchiha yep, I have tried that one (#1209), but the issue was still there. I found a bit other workaround: to be able to reload auto-turrets the pawn should take ammo in the inventory. But as described N7Huntsman, sometimes weird things happen.

Thanks for working on it! :)

@MadaraUchiha
Copy link
Contributor Author

By the way, @zhrocks11 @N7Huntsman early thoughts on that logger class? I figured such a thing was good to have in general and I didn't find a similar utility.

@N7Huntsman
Copy link
Contributor

@MadaraUchiha C# stuff isn't my wheelhouse, I'm afraid, so I couldn't weigh-in. @NoImageAvailable may have an opinion one way or another.

@MadaraUchiha
Copy link
Contributor Author

By the way, @zhrocks11 @N7Huntsman early thoughts on that logger class? I figured such a thing was good to have in general and I didn't find a similar utility.

cc @NoImageAvailable

@NoImageAvailable
Copy link
Collaborator

The correct C# pattern would be surrounding it with an #if DEBUG but CE also uses it's own set of dev settings in the controller class. That's where in-depth logging parameters live.

@MadaraUchiha
Copy link
Contributor Author

@NoImageAvailable I had thought of using the compiler preprocessor statements, but that would mean 3 lines for each logging statement, and that's just too sad.

I will look into the in-depth logging setting, thanks!

@MadaraUchiha MadaraUchiha force-pushed the refactor/destroy-genclosestammo-cache-class branch from 40dd9c9 to 5aeba13 Compare April 14, 2020 18:27
@MadaraUchiha MadaraUchiha marked this pull request as ready for review April 15, 2020 20:19
@MadaraUchiha MadaraUchiha requested review from a team as code owners April 15, 2020 20:19
Juanfrank and others added 9 commits April 17, 2020 22:12
Changing the CE 1.0 armorpenetration to armorpenetrationblunt using as a referente the Gun_Triple rucket and Gun_Doomsday Rocket armor pen values for the barrel
Adjusted the melee cooldown values to match the reference values.
Change ArmorPenetration to ArmorPenetration_Blunt for Heavy Charge Blaster, Charge Lance, Inferno Cannon and Minigun's melee attack with the barrel
…tches

Update Defensive Machine Gun Turret Pack patches
…ed/master

Merge tested and approved patches in master into dev, because I *am* the Senate.
Changes to a Postfix on DoDate(), similarly to FoodAlert.

- Also fixes totally unplayable misalignment of label
Also introduce local for the xOffset from the original method.
@MadaraUchiha MadaraUchiha force-pushed the refactor/destroy-genclosestammo-cache-class branch from bf63532 to c751c96 Compare April 18, 2020 22:18
N7Huntsman and others added 9 commits April 18, 2020 18:20
…ed/refactor/move-wind-alert-to-postfix

Change Wind alert from Transpiler to Postfix
About tweaks, death acidifier merc loadouts.
- Introduce CELogger class to log extra stuff in dev mode.
-- It is recommended to use this class instead of RimWorld's own Log
class.
- Introduce the JobGiverUtils_Reload class
-- Holds interesting job creation and ammo lookup logic.
- Various small refactors
- Small refactors in CompAmmoUser and JobDriver_ReloadTurret.
- Mechanoids now reload turrets with the JobGiver_DefenderReloadTurret
thinknode, patched into the Defend DutyDef.
- Turrets now only order reloads directly for manned pawns (i.e.
mortars)
- Ask for number of rounds missing to full, or the number of rounds in
the found stack. Whichever is smaller.
Will now toss a more meaningful error when MakeReloadJob is called
without checking for CanReload first.
@MadaraUchiha MadaraUchiha force-pushed the refactor/destroy-genclosestammo-cache-class branch from c751c96 to e8e9455 Compare April 19, 2020 15:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants