Just A Pearl Calculator Core Project Attempt.
- Any Bug report should be reported at GitHub Issue page. Any report on other platform won't be considered;
- Reporters should have experienced the problem himself otherwise won't be considered;
Please install the dotnet runtime before proceeding.
Some apps run on dotnet 6.0
Other apps run on dotnet core 3.1
This is a cross-platform graphical frontend for receiving parameters and presenting the results, based on AvaloniaUI.
- English
- 繁體中文
- 简体中文
Run cpbuild.ps1
using command prompt.
> cpbuild.ps1
Run cpbuild.sh
using terminal. You might need to change its file permissions before running this script, i.e. chmod +x cpbuild.sh
sh cpbuild.sh
options:
-scale [ratio] scale app based on the current screen dpi (e.g: PearlCalculatorCP -scale 1.25)
- You can use
/log tnt
to obtain the location of the exploding TNT entities.- Provided you have fabric carpet mod installed
- Beware of the spam
- You can use the
Options
in the top middle which hads the icon of three dots.- You can change the language in it. Do it twice sets the language as default.
- You can import a json formated settings file as a default settings in it.
- This application does not taking care about the range limit of the explosion and might create a wrong result or trigger an exception.
- The
direction
andangle
are displayed in the bottom right. - In the
General
section under theGeneral FTL
tab- You should round up the
Pearl
coordinates. - The settings can be saved to serve multiple purposes like storing the default parameter of a FTL for a perdicular server/design or storing the current result for a server member.
- You can name the json formated settings file whatever you want.
- You should round up the
- In the
Advanced
section under theGeneral
tab- The offsets are the displacement between the pearl and
Chamber Center
. (Pearl - Chamber Center) - In the
Result Sort Control
section- The track bar is used to change the weight of TNT.
- The radio buttons are used to change the sorting method.
- The offsets are the displacement between the pearl and
- In the
Settings
section under theGeneral FTL
tab- The switches in the TNT sections must be enabled before changing the parameters inside it. The purpose of it is to prevent any unexpected change by accident.
- X and Z axis are relatived to the
Chamber Center
. - Y Axis are global value.
DefaultRedDuper
andDefaultBlueDuper
must beOrdinal Direction
and should be oppose to each other.
- In the
Display
tab, if it is displaying results about the TNT configuration, you can sort it by clicking the header of theDistance
,Ticks
andTotal
column. Smaller value will be on the top. - In the
Manually
Tab- All the parameters are in global value.
- You can Enter two sets of TNT parameter side by side.
- If the application cannot find a possible TNT configuration, it will not give any notice.
The classes under this namespace are mostly used for calculating regular 360 degree FTL and not designed for FTL which can only handle certain angles.
-
The purpose of this class is for storing most parameters. If the necessary field is empty when the method of the Calculation class is called, it might create a wrong output or trigger an exception. The following section shows which parameters are needed for various methods in the Calculation class. If the following items do not include the information about which method to be used, it will be referred by
CalculateTNTAmount
,CalculatePearlTrace
andCalculateTNTVector
.TNT
data- You need to enter coordinates of the TNT.
- X and Z axis are relatived to the
Chamber Center
. - Y Axis are global value.
- X and Z axis are relatived to the
- You need to enter coordinates of the TNT.
destination
Data- To coordinate that you would like to teleport to
- Required by the
CalculateTNTAmount
method.
pearl
- Fill in its inital velocity (use
.WithVector()
method) and position (use.WithPosition()
method) - The coordinate of the pearl should be rounded up.
- Fill in its inital velocity (use
PearlOffset
- The offset between the actual pearl coordinate and the rounded up pearl coordinate.
BlueTNT
andRedTNT
- Amount of TNT to be exploded
- Not necessary and can be used for storing the data.
TNTWeight
- Number between 0 ~ 100.
- Higher number means solutions with more TNTs will be shown on top.
- For sorting the results
- Required by the sorting comparer in the TNTCalculationResultSortComparerByWeighted class.
MaxTNT
- The Max number of TNT on each side
- Required by the
CalculateTNTAmount
method.
MaxCalculateTNT
,MaxCalculateDistance
- Leave it empty
Direction
- Specifying the flying direction of the pearl(Only allowed for Cardinal Direction)
- Required by the
CalculatePearlTrace
method.
DefaultRedDuper
andDefaultBlueDuper
- Supply
Direction
as its value(Only allow for Ordinal Direction) - Indicate where the TNT will land on the lava with out moving it
- Supply
TNTResult
- Stores the calculated result
- Contains
- Flight duration in ticks
- redTNT
- blueTNT
- distance (displacement between the pearl and destination)
- totalTNT (blueTNT + redTNT)
The
TNT
andPearlOffset
parameters related to the X and Z axis, they are all relatived to thePearl
, also know asChamber Center
inPCCSettingsGenerator
, which is considered as the origin. For the Y axis, they are all global value. The following picture provides an illustration.This class is called for most calculations. It is composed of 4 differnt public methods which do different jobs. For the necessary parameters, please refer to Data class.
-
CalculateTNTAmount
is designed to calculate the configuration of the TNT and return abool
value indicating whether the calculation is seccessfully finished. The results of the possible TNT configurations will be stored in theTNTResult
which is one of the field in Data class. -
CalculatePearlTrace
is designed to simulate the pearl and retrieve its trace. It returns a list ofPearlEntity
which contains its motion and position in every tick. -
CalculateTNTConfiguration
is prepared as helping users to program the cannon. By providing the value with the same order, this method can generate the programing sequences. The result is passed by reference through theout
keyword. The return statment is returning the bool value indicating the seccessful of the calculation. -
CalculateTNTVector
is designed to calculate the vectors of the pearl. For more information, please refer to the summary.
This class serves as a data structure only for storing data which used to serialize or deserialize a json formated settings file.
This namespace is similar to PearlCalculatorLib.General
namespace. They serve a similar purpose but with a different input and/or output. All coordinates under this namespace are global value unlike the PearlCalculatorLib.General
namespace.
This namespace is used for providing an useful tools for other classes to handle complex calculations.
-
This namespace is reserved for furture development.
-
Those namespaces are used to provide some useful tools for other classes.
-
This namespace is used for handling the result of
CalculateTNTAmount
. It contains sorting comparers for sorting with different order base onTNT amount
,ticks
,distance
. -
This namespace is used for providing the useful tools for handling the world coordinates and direction.
-
This class is aimed for calculating the acceleration of the pearl with the given input of TNT coordinates and pearl coordinates. Please note that it doesn't handle the distance limit set by Mojang and if it is over the raycasting range, it might return a wrong result or throw an exception.
Sorry about the wrong file name, but changing it causes problem.
What this project does is to help FTL designers to generate settings easily by providing some parameters taken from the game and generate the settings you want. It can also save the settings to a json formated settings file for PearlCalculatorCP to use.
- English
- 繁體中文
- 简体中文
If you want to provide a language support, feel free to provide a resx formated language file in PCCSettingsCalculator/Resources/ folder through pull request.
This is more like a debug purposed version of PearlCalculatorCP
. It have intergrated some useful commands for peeking and changing the hidden parameters. It does not
features language support other than English
and we are rarely maintain it.
This is purely make for Debug Purposed
and not for anyone to used it. It is used to varify the correctness of the PearlCalculatorLib
.