trinomials
Terrarian
alright figured it out it works now
Thanks!You'll probably need to use a ModPlayer and set a bool variable in the debuff's Update method. Then check for that bool in several ModPlayer methods. Don't forget to reset the bool variable in ResetEffects or it won't ever wear off.
For the regen, see ModPlayer.UpdateBadLifeRegen
For stats, that's a bit more vague because there are a bunch of them. Probably the easiest thing to do is put some of the code ModPlayer.PostUpdate
Change the main stats like max health and mana there with
There are a ton of other things like mana regen, movement speed, various crit chances, etc. You'll need to figure out what you want to alter.Code:player.statLifeMax2 = (int)(player.statLifeMax2 * 0.95f); player.statManaMax2 = (int)(player.statManaMax2 * 0.95f); player.statDefense = (int)(player.statDefense * 0.95f);
And finally use ModPlayer.GetWeaponDamage to lower the player's damage by 5% rather than try to lower all the various damage stats.
[doublepost=1486826454,1486826115][/doublepost]
You need "projectile.position" instead of "this.position". To change the color, the three arguments after the position indicate red, green, and blue in a scale from 0 to 1. So all 1's will be a white light. If you set the first two to 0.5f then it'll be a light blue.
I don't think there's going to be an example for an accessory like that. Mainly because it's just too non-generic. If you want to create said accessory, you'll have to study how vanilla code handles the paladin accessory.Could you please make a tutorial on how to make a paladins shield kind of accessory, or an accessory that makes you take like 10% of damage taken to people on your team?
OK, I understand about 10% of that, but thanks anyway.You'll probably need to use a ModPlayer and set a bool variable in the debuff's Update method. Then check for that bool in several ModPlayer methods. Don't forget to reset the bool variable in ResetEffects or it won't ever wear off.
For the regen, see ModPlayer.UpdateBadLifeRegen
For stats, that's a bit more vague because there are a bunch of them. Probably the easiest thing to do is put some of the code ModPlayer.PostUpdate
Change the main stats like max health and mana there with
There are a ton of other things like mana regen, movement speed, various crit chances, etc. You'll need to figure out what you want to alter.Code:player.statLifeMax2 = (int)(player.statLifeMax2 * 0.95f); player.statManaMax2 = (int)(player.statManaMax2 * 0.95f); player.statDefense = (int)(player.statDefense * 0.95f);
And finally use ModPlayer.GetWeaponDamage to lower the player's damage by 5% rather than try to lower all the various damage stats.
[doublepost=1486826454,1486826115][/doublepost]
You need "projectile.position" instead of "this.position". To change the color, the three arguments after the position indicate red, green, and blue in a scale from 0 to 1. So all 1's will be a white light. If you set the first two to 0.5f then it'll be a light blue.
using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace WeaponsMod.Sounds.Items.Weapons
{
public class GLSound : ModSound
{
public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type)
{
// By creating a new instance, this ModSound allows for overlapping sounds. Non-ModSound behavior is to restart the sound, only permitting 1 instance.
soundInstance = sound.CreateInstance();
soundInstance.Volume = volume * .5f;
soundInstance.Pan = pan;
soundInstance.Pitch = -1.0f;
return soundInstance;
}
}
}
There should be a vanilla backup Terraria.exe file in your Steam folder (if you own the Steam version, ofc).how do i play with out tmodloader?
I never used to have frame rate drops, but they've started to happen to me lately. Usually when I have the menu open, but sometimes during normal gameplay too. I found that hiding the interface with F11 usually brings the framerate back to normal.Need a bit of help, have tried looking for any new topics on this, but nothings come up, only old threads.
Whenever I throw on armor pieces from any mod, my game starts to have FPS drops, to the point where everything is basically slow motion. Any idea on how to possibly fix this, or if anyone else is having this problem? I've seen old threads about it, but nothing new so I'm very much in the dark right now.
See ExampleBulletIs it possible to add afterimage to projectiles ?
I will when I arrive home. Thanks.See ExampleBullet