Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
ItemGlowMask MP Server fix, useStyle 5 support (#22)
Browse files Browse the repository at this point in the history
* Added .editorconfig

* Initial migration of ModRecipes

Still needs redoing

* Removed redundant TremorGlobalNPC

* Formatting

* Fixed compile errors from PR #4

* Restructured NovaPillar dir

* Fixed Nova placeables

* Fixed DiceZombie no drops in MP

* Update to 1.3.2 changelogs

* Hopefully fixes #5

* Introduced NewItemFast

* Motherboard small improvements

Refactoring, generic calls, NPCLoot slightly improved
Note: still bugged in MP

* Motherboard improvements, still MP bugged

* Fixes #6

* Fixes #7 (Infinite stimpacks)

Stimpack improvements

* Translated comments (#8)

* v1.3.2 for tML v0.10.0.2

* More formatting

* Fixed 'broken' Main.rand.Next(1) calls

* Create README.md

* Added contribution guidelines

* Updated build.txt to ignore markdown files

* Undoes dd549d7 which fixes #10

* [Rework] TremorWorld downed bosses bools (#9)

* TremorWorld downed bosses bools revamped

* Removed odd bit of code

* Renamed DownedBoss -> Boss

Suggested by Mirsario

* Simplified Downed check

* Fixed Downed helper

This got replaced accidentally with the regex mass replace

* [Refactor] HeaterOfWorlds (#11)

* Revised HeaterOfWorlds

* Fixed compile errors

C#7 feature

* Finalizing refactor

* Finalizing refactor

* Removed merge artifact, fixes compile error

* v1.3.2.1 release

* Remove bad setdefaults, noted a bug, fixed Unload to restore textures. (#13)

* Fixes summon BabySlime+Crab then desummon BabySlime buff problem. (#14)

* Remove bad setdefaults, noted a bug, fixed Unload to restore textures.

* Fixes summon BabySlime+Crab then desummon BabySlime buff problem.

* InvasionWorld fix, potential bug fix

* Tremor.cs improvements

* Fixes #16

* Fixes #15

* Improved TremorPlayer quest fish

* Improved TremorPlayer bad life regen

* TikiTotem improvements

* Fixed motherboard drops

* Fixed TikiTotem drops, again...

Potions now drop 5-15
ToxicHilt drop chance fixed from 33% to 25%
ToxicBlade drop chance fixed from 50% to 33%
JungleAlloy drop chance fixed from 50% to 100%
Potion drop chances fixed from 50% to 100%
Boss bag drops all normal drops plus Tiki Skull

* Fixed TikiTotem/Motherboard treasure bag name/tt

* Fixed motherboard expert only drop

* Fixed some flasks no crit, fixed shadow flask

* Fixed alchemist item to 'alchemical' damage

* 💎 v1.3.2.2

* ItemGlowMask Stuff

Added useStyle 5 support.
Fixed SetStaticDefault bug (shouldn't have been a problem. Needs to be
checked on tML's calling end).
  • Loading branch information
Rartrin authored and Jofairden committed Aug 19, 2017
1 parent 5049ebd commit 63a4cb7
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 13 deletions.
2 changes: 1 addition & 1 deletion TremorGlowMask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal static void Unload()

public static void AddGlowMask(int itemType, string texturePath)
{
ItemGlowMask.Add(itemType, ModLoader.GetTexture(texturePath));
ItemGlowMask[itemType]=ModLoader.GetTexture(texturePath);
}

public override void ModifyDrawLayers(List<PlayerLayer> layers)
Expand Down
51 changes: 39 additions & 12 deletions TremorUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,52 @@ public static void DrawArmorGlowMask(EquipType type, Texture2D texture, PlayerDr

public static void DrawItemGlowMask(Texture2D texture, PlayerDrawInfo info)
{
Item item = info.drawPlayer.HeldItem;
if (info.shadow != 0f || info.drawPlayer.frozen || ((info.drawPlayer.itemAnimation <= 0 || item.useStyle == 0) && (item.holdStyle <= 0 || info.drawPlayer.pulley)) || item.type <= 0 || info.drawPlayer.dead || item.noUseGraphic || (info.drawPlayer.wet && item.noWet))
Item item=info.drawPlayer.HeldItem;
if(info.shadow!=0f||info.drawPlayer.frozen||((info.drawPlayer.itemAnimation<=0||item.useStyle==0)&&(item.holdStyle<=0||info.drawPlayer.pulley))/*||item.type<=0*/||info.drawPlayer.dead||item.noUseGraphic||(info.drawPlayer.wet&&item.noWet))
{
return;
}
Vector2 offset=new Vector2();
float rotOffset=0;
Vector2 origin=new Vector2();
if(item.useStyle==5)
{
if(Item.staff[item.type])
{
rotOffset=0.785f*info.drawPlayer.direction;
if(info.drawPlayer.gravDir==-1f){rotOffset-=1.57f*info.drawPlayer.direction;}
origin=new Vector2(texture.Width*0.5f*(1-info.drawPlayer.direction),(info.drawPlayer.gravDir==-1f)?0:texture.Height);
int num86=-(int)origin.X;
ItemLoader.HoldoutOrigin(info.drawPlayer,ref origin);
offset=new Vector2(origin.X+num86,0);
}
else
{
offset=new Vector2(10,texture.Height/2);
ItemLoader.HoldoutOffset(info.drawPlayer.gravDir,item.type,ref offset);
origin=new Vector2(-offset.X,texture.Height/2);
if(info.drawPlayer.direction==-1)
{
origin.X=texture.Width+offset.X;
}
offset=new Vector2(texture.Width/2,offset.Y);
}
}
else
{
origin=new Vector2(texture.Width*0.5f*(1-info.drawPlayer.direction),(info.drawPlayer.gravDir==-1f)?0:texture.Height);
}
Main.playerDrawData.Add
(
new DrawData
(
texture, info.itemLocation - Main.screenPosition,
new Rectangle(0, 0, texture.Width, texture.Height),
new Color(250, 250, 250, item.alpha),
info.drawPlayer.itemRotation,
new Vector2
(
texture.Width * 0.5f * (1 - info.drawPlayer.direction),
info.drawPlayer.gravDir == -1f ? 0 : texture.Height
),
item.scale, info.spriteEffects, 0
texture,
info.itemLocation-Main.screenPosition+offset,
texture.Bounds,
new Color(250,250,250,item.alpha),
info.drawPlayer.itemRotation+rotOffset,
origin,
item.scale,info.spriteEffects,0
)
);
}
Expand Down

0 comments on commit 63a4cb7

Please sign in to comment.