Browse Source

Change to support new AcediaCore changes

feature_improvement
Anton Tarasenko 2 years ago
parent
commit
8ea048df03
  1. 4
      sources/Commands/ACommandGod.uc
  2. 6
      sources/Commands/ACommandInventory.uc
  3. 8
      sources/Commands/ACommandSpawn.uc
  4. 34
      sources/Commands/ACommandTrader.uc
  5. 2
      sources/Commands/ACommandUserData.uc

4
sources/Commands/ACommandGod.uc

@ -38,7 +38,7 @@ var private const int TDAMAGE, TMOMENTUM;
protected function Finalizer()
{
_.memory.Free(announcer);
_.kf.health.OnDamage(self).Disconnect();
_server.kf.health.OnDamage(self).Disconnect();
super.Finalizer();
}
@ -62,7 +62,7 @@ protected function BuildData(CommandDataBuilder builder)
@ "affected by the momentum trasnferred from damaging attacks."));
announcer = ACommandGod_Announcer(
_.memory.Allocate(class'ACommandGod_Announcer'));
_.kf.health.OnDamage(self).connect = ProtectDivines;
_server.kf.health.OnDamage(self).connect = ProtectDivines;
}
protected function ExecutedFor(

6
sources/Commands/ACommandInventory.uc

@ -239,7 +239,7 @@ protected function array<Text> LoadAllItemsLists(ArrayList specifiedLists)
}
badLists = ListBuilder(_.memory.Allocate(class'ListBuilder'));
callerConsole.Write(T(TLISTS_SKIPPED));
availableLists = _.kf.templates.GetAvailableLists();
availableLists = _server.kf.templates.GetAvailableLists();
for (i = 0; i < specifiedLists.GetLength(); i += 1)
{
nextList = specifiedLists.GetText(i);
@ -270,14 +270,14 @@ protected function array<Text> LoadItemsList(
for (i = 0; i < availableLists.length; i += 1)
{
if (availableLists[i].Compare(listName, SCASE_INSENSITIVE)) {
return _.kf.templates.GetItemList(availableLists[i]);
return _server.kf.templates.GetItemList(availableLists[i]);
}
}
// Prefix matching otherwise
for (i = 0; i < availableLists.length; i += 1)
{
if (availableLists[i].StartsWith(listName, SCASE_INSENSITIVE)) {
return _.kf.templates.GetItemList(availableLists[i]);
return _server.kf.templates.GetItemList(availableLists[i]);
}
}
badLists.Item(listName);

8
sources/Commands/ACommandSpawn.uc

@ -82,7 +82,7 @@ private final function SpawnAt(
{
local EPlaceable result;
result = _.kf.world.Spawn(template, spawnLocation);
result = _server.kf.world.Spawn(template, spawnLocation);
if (result != none) {
announcer.AnnounceSpawned(template);
}
@ -100,21 +100,21 @@ private final function SpawnInInstigatorSight(
local Vector spawnLocation;
local TracingIterator iter;
iter = _.kf.world.TracePlayerSight(instigator).LeaveOnlyVisible();
iter = _server.kf.world.TracePlayerSight(instigator).LeaveOnlyVisible();
if (iter.HasFinished())
{
announcer.AnnounceFailedTrace();
return;
}
spawnLocation = iter.GetHitLocation();
result = _.kf.world.Spawn(template, spawnLocation);
result = _server.kf.world.Spawn(template, spawnLocation);
// Shift position back a little and try again;
// this should fix a ton of spawning failures
if (result == none)
{
spawnLocation = spawnLocation +
Normal(iter.GetTracingStart() - spawnLocation) * 100;
result = _.kf.world.Spawn(template, spawnLocation);
result = _server.kf.world.Spawn(template, spawnLocation);
}
if (result != none) {
announcer.AnnounceSpawned(template);

34
sources/Commands/ACommandTrader.uc

@ -109,11 +109,11 @@ protected function Executed(CallData arguments, EPlayer instigator)
{
newTradingStatus = arguments.parameters.GetBool(T(TENABLE));
if ( arguments.parameters.GetBool(T(TENABLE))
== _.kf.trading.IsTradingActive())
== _server.kf.trading.IsTradingActive())
{
announcer.AnnounceTradingNoChange();
}
_.kf.trading.SetTradingStatus(newTradingStatus);
_server.kf.trading.SetTradingStatus(newTradingStatus);
if (newTradingStatus) {
announcer.AnnounceActivatedTrading();
}
@ -159,7 +159,7 @@ protected function ListTradersFor(EPlayer target)
if (target == none) {
return;
}
availableTraders = _.kf.trading.GetTraders();
availableTraders = _server.kf.trading.GetTraders();
callerConsole.Flush()
.UseColorOnce(_.color.TextEmphasis).Write(T(TLIST_TRADERS));
closestTrader = FindClosestTrader(target);
@ -185,11 +185,11 @@ protected function HandleTraderTime(CallData result)
parameter = result.parameters.GetText(T(TTRADER_TIME));
if (parameter.Compare(T(TPAUSE), SCASE_INSENSITIVE))
{
oldIsPaused = _.kf.trading.IsCountDownPaused();
oldIsPaused = _server.kf.trading.IsCountDownPaused();
if (!oldIsPaused) {
_.kf.trading.SetCountdownPause(true);
_server.kf.trading.SetCountdownPause(true);
}
newIsPaused = _.kf.trading.IsCountDownPaused();
newIsPaused = _server.kf.trading.IsCountDownPaused();
if (oldIsPaused != newIsPaused) {
announcer.AnnouncePausedTime();
}
@ -197,11 +197,11 @@ protected function HandleTraderTime(CallData result)
}
else if (parameter.Compare(T(TUNPAUSE), SCASE_INSENSITIVE))
{
oldIsPaused = _.kf.trading.IsCountDownPaused();
oldIsPaused = _server.kf.trading.IsCountDownPaused();
if (oldIsPaused) {
_.kf.trading.SetCountdownPause(false);
_server.kf.trading.SetCountdownPause(false);
}
newIsPaused = _.kf.trading.IsCountDownPaused();
newIsPaused = _server.kf.trading.IsCountDownPaused();
if (oldIsPaused != newIsPaused) {
announcer.AnnounceUnpausedTime();
}
@ -210,8 +210,8 @@ protected function HandleTraderTime(CallData result)
parser = _.text.Parse(parameter);
if (parser.MInteger(countDownValue).Ok())
{
_.kf.trading.SetCountdown(countDownValue);
announcer.AnnounceChangedCountdown(_.kf.trading.GetCountdown());
_server.kf.trading.SetCountdown(countDownValue);
announcer.AnnounceChangedCountdown(_server.kf.trading.GetCountdown());
}
else
{
@ -277,7 +277,7 @@ protected function SelectTrader(CallData result, EPlayer callerPlayer)
local Text specifiedTraderName;
local ETrader previouslySelectedTrader, newlySelectedTrader;
previouslySelectedTrader = _.kf.trading.GetSelectedTrader();
previouslySelectedTrader = _server.kf.trading.GetSelectedTrader();
specifiedTraderName = result.parameters.GetText(T(TTRADER));
// Try to get trader user want to select:
// first try closes (if option is specified), next trader's name
@ -285,7 +285,7 @@ protected function SelectTrader(CallData result, EPlayer callerPlayer)
newlySelectedTrader = FindClosestTrader(callerPlayer);
}
if (newlySelectedTrader == none) {
newlySelectedTrader = _.kf.trading.GetTrader(specifiedTraderName);
newlySelectedTrader = _server.kf.trading.GetTrader(specifiedTraderName);
}
// If nothing is found, but name was specified - there is an error
if (newlySelectedTrader == none && specifiedTraderName != none)
@ -298,7 +298,7 @@ protected function SelectTrader(CallData result, EPlayer callerPlayer)
}
// Select proper trader
HandleTraderSwap(result, previouslySelectedTrader, newlySelectedTrader);
_.kf.trading.SelectTrader(newlySelectedTrader);
_server.kf.trading.SelectTrader(newlySelectedTrader);
// Report change
if (AreTradersSame(previouslySelectedTrader, newlySelectedTrader)) {
announcer.AnnounceSelectedSameTrader();
@ -352,7 +352,7 @@ protected function BootFromTraders(CallData result, EPlayer callerPlayer)
affectedTraderList = ListBuilder(_.memory.Allocate(class'ListBuilder'));
selectedTraders = GetTradersArray(result, callerPlayer);
if (selectedTraders.length <= 0) {
selectedTraders = _.kf.trading.GetTraders();
selectedTraders = _server.kf.trading.GetTraders();
}
for (i = 0; i < selectedTraders.length; i += 1)
{
@ -441,7 +441,7 @@ protected function array<ETrader> GetTradersArray(
local array<ETrader> resultTraders;
local array<ETrader> availableTraders;
// Boundary cases: all traders and no traders at all
availableTraders = _.kf.trading.GetTraders();
availableTraders = _server.kf.trading.GetTraders();
if (result.options.HasKey(T(TALL))) {
return availableTraders;
}
@ -547,7 +547,7 @@ protected function ETrader FindClosestTrader(EPlayer target)
return none;
}
targetLocation = target.GetLocation();
availableTraders = _.kf.trading.GetTraders();
availableTraders = _server.kf.trading.GetTraders();
for (i = 0; i < availableTraders.length; i += 1)
{
newDistance =

2
sources/Commands/ACommandUserData.uc

@ -106,7 +106,7 @@ private final function UserDataRead(
asJSON = _.json.PrettyPrint(userData);
targetPlayer.BorrowConsole()
.Write(F("{$TextPositive User data for player}"))
.Write(targetPlayerName);
.Write(targetPlayerName)
.Write(P(":"))
.WriteLine(asJSON);
_.memory.Free(targetPlayer);

Loading…
Cancel
Save