Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Commit

Permalink
moved the project to a separate folder, updated for RogueLibs v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Chasmical committed Aug 2, 2020
1 parent 2c44b16 commit 5f3a21a
Show file tree
Hide file tree
Showing 64 changed files with 171 additions and 93 deletions.
Binary file modified .vs/aTonOfItems/v16/.suo
Binary file not shown.
Binary file modified .vs/slnx.sqlite
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file added Libraries/RogueLibs.dll
Binary file not shown.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion aTonOfItems.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30114.105
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "aTonOfItems", "aTonOfItems.csproj", "{FBCCD945-31CB-4059-B7E7-0DA572AA27C2}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "aTonOfItems", "aTonOfItems\aTonOfItems.csproj", "{FBCCD945-31CB-4059-B7E7-0DA572AA27C2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
127 changes: 91 additions & 36 deletions source/aToI.cs → aTonOfItems/aToI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace aTonOfItems
{
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
[BepInDependency(RogueLibs.pluginGuid, "1.3.3")]
[BepInDependency(RogueLibs.pluginGuid, "2.0.0")]
public class ATOI : BaseUnityPlugin
{
public const string pluginGuid = "abbysssal.streetsofrogue.atoi";
Expand All @@ -20,7 +20,7 @@ public void Awake()

#region Quantum Fud
Sprite sprite1 = RogueUtilities.ConvertToSprite(Properties.Resources.QuantumFud);
CustomItem quantumFud = RogueLibs.SetItem("QuantumFud", sprite1,
CustomItem quantumFud = RogueLibs.CreateCustomItem("QuantumFud", sprite1, false,
new CustomNameInfo("Quantum Fud",
null, null, null, null,
"Квантовый хафчик",
Expand All @@ -39,6 +39,12 @@ public void Awake()
item.cantBeCloned = true;
item.goesInToolbar = true;
});
quantumFud.Prerequisites.Add("FoodProcessor");
quantumFud.Prerequisites.Add("Fud");

quantumFud.UnlockCost = 10;
quantumFud.CostInCharacterCreation = 10;
quantumFud.CostInLoadout = 10;

quantumFud.UseItem = (item, agent) =>
{
Expand Down Expand Up @@ -70,7 +76,7 @@ public void Awake()

#region Wild Bypasser
Sprite sprite2 = RogueUtilities.ConvertToSprite(Properties.Resources.WildBypasser);
CustomItem wildBypasser = RogueLibs.SetItem("WildBypasser", sprite2,
CustomItem wildBypasser = RogueLibs.CreateCustomItem("WildBypasser", sprite2, false,
new CustomNameInfo("Wild Bypasser",
null, null, null, null,
"Универсальный проход сквозь стены",
Expand All @@ -86,11 +92,17 @@ public void Awake()
item.Categories.Add("Usable");
item.Categories.Add("Stealth");
item.itemValue = 60;
item.initCount = 1;
item.rewardCount = 2;
item.initCount = 2;
item.rewardCount = 3;
item.stackable = true;
item.goesInToolbar = true;
});
wildBypasser.Prerequisites.Add("WallBypasser");

wildBypasser.UnlockCost = 10;
wildBypasser.CostInCharacterCreation = 5;
wildBypasser.CostInLoadout = 5;

wildBypasser.UseItem = (item, agent) =>
{
Vector3 position = agent.agentHelperTr.localPosition = Vector3.zero;
Expand Down Expand Up @@ -125,7 +137,7 @@ public void Awake()
VoodooUpdateList = new Dictionary<InvItem, Agent>();

Sprite sprite3 = RogueUtilities.ConvertToSprite(Properties.Resources.VoodooInactive);
CustomItem blankVoodooDoll = RogueLibs.SetItem("BlankVoodooDoll", sprite3,
CustomItem blankVoodooDoll = RogueLibs.CreateCustomItem("BlankVoodooDoll", sprite3, false,
new CustomNameInfo("Blank Voodoo Doll",
null, null, null, null,
"Непривязанная кукла Вуду",
Expand All @@ -147,6 +159,10 @@ public void Awake()
item.hasCharges = true;
item.goesInToolbar = true;
});
blankVoodooDoll.UnlockCost = 10;
blankVoodooDoll.CostInCharacterCreation = 10;
blankVoodooDoll.CostInLoadout = 5;

blankVoodooDoll.TargetFilter = (item, agent, obj) => obj is Agent a && !a.dead;
blankVoodooDoll.TargetObject = (item, agent, obj) =>
{
Expand All @@ -158,13 +174,13 @@ public void Awake()
VoodooUpdateList.Add(newItem, (Agent)obj);
VoodooCooldowns.Add(newItem, 0f);
};
blankVoodooDoll.SetHoverText(new CustomNameInfo("Bind",
blankVoodooDoll.SetTargetText(new CustomNameInfo("Bind",
null, null, null, null,
"Привязать",
null, null));

Sprite sprite4 = RogueUtilities.ConvertToSprite(Properties.Resources.Voodoo);
CustomItem voodooDoll = RogueLibs.SetItem("VoodooDoll2", sprite4,
CustomItem voodooDoll = RogueLibs.CreateCustomItem("VoodooDoll2", sprite4, false,
new CustomNameInfo("Voodoo Doll",
null, null, null, null,
"Кукла Вуду",
Expand All @@ -185,6 +201,10 @@ public void Awake()
item.stackable = true;
item.hasCharges = true;
});
voodooDoll.Available = false;
voodooDoll.AvailableInCharacterCreation = false;
voodooDoll.AvailableInItemTeleporter = false;

voodooDoll.CombineFilter = (item, agent, otherItem) =>
{
if (otherItem.itemType == "WeaponMelee") return true;
Expand All @@ -194,24 +214,18 @@ public void Awake()

return false;
};
voodooDoll.CombineItem = (item, agent, otherItem, slotNum) =>
voodooDoll.CombineItems = (item, agent, otherItem) =>
{
foreach (var a in VoodooCooldowns)
{
foreach (KeyValuePair<InvItem, float> a in VoodooCooldowns)
if (a.Key.invItemID == item.invItemID && a.Value > 0)
{
return;
}
}
Agent target = null;
foreach (var a in VoodooUpdateList)
{
foreach (KeyValuePair<InvItem, Agent> a in VoodooUpdateList)
if (a.Key.invItemID == item.invItemID)
{
target = a.Value;
break;
}
}
if (otherItem == item)
{
item.database.DestroyItem(item);
Expand Down Expand Up @@ -304,7 +318,7 @@ public void Awake()

#region SPYTRON 3000
Sprite sprite5 = RogueUtilities.ConvertToSprite(Properties.Resources.SPYTRON3000);
CustomItem identityStealer = RogueLibs.SetItem("SPYTRON3000", sprite5,
CustomItem spytron3000 = RogueLibs.CreateCustomItem("SPYTRON3000", sprite5, false,
new CustomNameInfo("SPYTRON 3000",
null, null, null, null,
"Шпионотрон 3000",
Expand All @@ -320,14 +334,22 @@ public void Awake()
item.Categories.Add("Stealth");
item.Categories.Add("Technology");
item.Categories.Add("Usable");
item.itemValue = 80;
item.itemValue = 40;
item.initCount = 2;
item.rewardCount = 3;
item.stackable = true;
item.goesInToolbar = true;
});
identityStealer.TargetFilter = (item, agent, obj) => obj is Agent a && !a.dead && a != agent;
identityStealer.TargetObject = (item, agent, obj) =>
spytron3000.Prerequisites.Add("Hypnotizer2");
spytron3000.Prerequisites.Add("Haterator");
spytron3000.Prerequisites.Add("MemoryEraser");

spytron3000.UnlockCost = 10;
spytron3000.CostInCharacterCreation = 5;
spytron3000.CostInLoadout = 3;

spytron3000.TargetFilter = (item, agent, obj) => obj is Agent a && !a.dead && a != agent;
spytron3000.TargetObject = (item, agent, obj) =>
{
Agent target = (Agent)obj;

Expand Down Expand Up @@ -361,15 +383,15 @@ public void Awake()
item.database.SubtractFromItemCount(item, 1);
item.invInterface.HideTarget();
};
identityStealer.SetHoverText(new CustomNameInfo("Disguise",
spytron3000.SetTargetText(new CustomNameInfo("Disguise",
null, null, null, null,
"Замаскироваться",
null, null));
#endregion

#region Cup of Molten Chocolate
Sprite sprite6 = RogueUtilities.ConvertToSprite(Properties.Resources.CupOfMoltenChocolate);
CustomItem cupOfMoltenChocolate = RogueLibs.SetItem("CupOfMoltenChocolate", sprite6,
CustomItem cupOfMoltenChocolate = RogueLibs.CreateCustomItem("CupOfMoltenChocolate", sprite6, false,
new CustomNameInfo("Cup of Molten Chocolate",
null, null, null, null,
"Кружка расплавленного шоколада",
Expand All @@ -392,12 +414,19 @@ public void Awake()
item.meleeDamage = 1;
item.hitSoundType = "Normal";
});
cupOfMoltenChocolate.Prerequisites.Add("Sledgehammer");
cupOfMoltenChocolate.Prerequisites.Add("BraceletStrength");

cupOfMoltenChocolate.UnlockCost = 10;
cupOfMoltenChocolate.CostInCharacterCreation = 5;
cupOfMoltenChocolate.CostInLoadout = 5;

patcher.Prefix(typeof(PlayfieldObject), "FindDamage", new Type[] { typeof(PlayfieldObject), typeof(bool), typeof(bool), typeof(bool) });
#endregion

#region Portable Ammo Dispenser
Sprite sprite7 = RogueUtilities.ConvertToSprite(Properties.Resources.PortableAmmoDispenser);
CustomItem portableAmmoDispenser = RogueLibs.SetItem("PortableAmmoDispenser", sprite7,
CustomItem portableAmmoDispenser = RogueLibs.CreateCustomItem("PortableAmmoDispenser", sprite7, false,
new CustomNameInfo("Portable Ammo Dispenser",
null, null, null, null,
"Портативный раздатчик боеприпасов",
Expand All @@ -416,8 +445,15 @@ public void Awake()
item.initCount = 1;
item.rewardCount = 1;
});
portableAmmoDispenser.Prerequisites.Add("AmmoCapacityMod");
portableAmmoDispenser.Prerequisites.Add("KillProfiterAmmo");

portableAmmoDispenser.UnlockCost = 10;
portableAmmoDispenser.CostInCharacterCreation = 3;
portableAmmoDispenser.CostInLoadout = 3;

portableAmmoDispenser.CombineFilter = (item, agent, otherItem) => otherItem.itemType == "WeaponProjectile" && !otherItem.noRefills;
portableAmmoDispenser.CombineItem = (item, agent, otherItem, slotNum) =>
portableAmmoDispenser.CombineItems = (item, agent, otherItem) =>
{
int amountToRefill = otherItem.maxAmmo - otherItem.invItemCount;
float singleCost = (float)otherItem.itemValue / otherItem.maxAmmo;
Expand Down Expand Up @@ -472,7 +508,7 @@ public void Awake()

#region Ammo Box
Sprite sprite8 = RogueUtilities.ConvertToSprite(Properties.Resources.AmmoBox);
CustomItem ammoBox = RogueLibs.SetItem("AmmoBox", sprite8,
CustomItem ammoBox = RogueLibs.CreateCustomItem("AmmoBox", sprite8, false,
new CustomNameInfo("Ammo Box",
null, null, null, null,
"Ящик с боеприпасами",
Expand All @@ -493,8 +529,14 @@ public void Awake()
item.hasCharges = true;
item.stackable = true;
});
ammoBox.Prerequisites.Add(portableAmmoDispenser.Id);

ammoBox.UnlockCost = 10;
ammoBox.CostInCharacterCreation = 3;
ammoBox.CostInLoadout = 3;

ammoBox.CombineFilter = (item, agent, otherItem) => otherItem.itemType == "WeaponProjectile" && !otherItem.noRefills;
ammoBox.CombineItem = (item, agent, otherItem, slotNum) =>
ammoBox.CombineItems = (item, agent, otherItem) =>
{
int amountToRefill = otherItem.maxAmmo - otherItem.invItemCount;
float singleCost = (float)otherItem.itemValue / otherItem.maxAmmo;
Expand Down Expand Up @@ -535,7 +577,7 @@ public void Awake()

#region Joke Book
Sprite sprite9 = RogueUtilities.ConvertToSprite(Properties.Resources.JokeBook);
CustomItem jokeBook = RogueLibs.SetItem("JokeBook", sprite9,
CustomItem jokeBook = RogueLibs.CreateCustomItem("JokeBook", sprite9, false,
new CustomNameInfo("Joke Book",
null, null, null, null,
"Always wanted to be a Comedian? Now you can! (kind of)",
Expand All @@ -549,13 +591,19 @@ public void Awake()
item.itemType = "Tool";
item.Categories.Add("Usable");
item.Categories.Add("Social");
item.itemValue = 200;
item.itemValue = 40;
item.initCount = 10;
item.rewardCount = 10;
item.stackable = true;
item.hasCharges = true;
item.goesInToolbar = true;
});
jokeBook.Prerequisites.Add("Comedian_BQ");

jokeBook.UnlockCost = 10;
jokeBook.CostInCharacterCreation = 3;
jokeBook.CostInLoadout = 3;

jokeBook.UseItem = (item, agent) =>
{
string prev = agent.specialAbility;
Expand All @@ -569,10 +617,10 @@ public void Awake()

#region Grindstone
Sprite sprite10 = RogueUtilities.ConvertToSprite(Properties.Resources.Grindstone);
CustomItem grindstone = RogueLibs.SetItem("Grindstone", sprite10,
new CustomNameInfo("Grindstone",
CustomItem grindstone = RogueLibs.CreateCustomItem("Grindstone", sprite10, false,
new CustomNameInfo("Grindstone WIP",
null, null, null, null,
"Точильный камень",
"Точильный камень WIP",
null, null),
new CustomNameInfo("Use on melee weapons to sharpen them. Sharpened weapons will ignore all damage-reducing effects.",
null, null, null, null,
Expand All @@ -584,14 +632,21 @@ public void Awake()
item.Categories.Add("Technology");
item.Categories.Add("MeleeAccessory");
item.Categories.Add("Melee");
item.itemValue = 4;
item.initCount = 100;
item.rewardCount = 100;
item.itemValue = 40;
item.initCount = 10;
item.rewardCount = 10;
item.hasCharges = true;
item.stackable = true;
});
grindstone.Prerequisites.Add("MeleeDurabilityDoubler");
grindstone.Prerequisites.Add("MeleeLastLonger");

grindstone.UnlockCost = 10;
grindstone.CostInCharacterCreation = 5;
grindstone.CostInLoadout = 5;

grindstone.CombineFilter = (item, agent, otherItem) => otherItem.itemType == "WeaponMelee" && !otherItem.contents.Exists(c => c.StartsWith("Sharpened:"));
grindstone.CombineItem = (item, agent, otherItem, slotNum) =>
grindstone.CombineItems = (item, agent, otherItem) =>
{
otherItem.contents.Add("Sharpened:3");
item.database.SubtractFromItemCount(item, 1);
Expand Down
Loading

0 comments on commit 5f3a21a

Please sign in to comment.