Skip to content

่‡ชๅฎšไน‰ไธ“้•ฟ โ€‹

่‡ชๅฎšไน‰ไธ“้•ฟ็ฑปๅฟ…้กปไปŽ Feat ๆดพ็”Ÿใ€‚

cs
internal class FeatMyExample: Feat

ๅบ”็”จไบ‹ไปถ โ€‹

็”ฑไบŽ Elin ๅฐ†ๆ‰€ๆœ‰ไธ“้•ฟๆ•ˆๆžœ้ƒฝๅ†™ๅœจ Feat.Apply ่ฟ™ไธชๆ–นๆณ•ไธญ๏ผŒCWL ๆไพ›ไบ†ไธ€ไธชไบ‹ไปถ _OnApply๏ผŒ้€š่ฟ‡ๅœจไฝ ็š„ไธ“้•ฟ็ฑปไธญๅฎšไน‰ไธ€ไธชๅฏ้€‰็š„ไบ‹ไปถๅค„็† _OnApply ไปฅไพฟๅบ”็”จไฝ ่‡ชๅทฑ็š„ไธ“้•ฟๆ•ˆๆžœ๏ผš

cs
internal class FeatMyExample : Feat
{
    internal void _OnApply(int add, ElementContainer eleOwner, bool hint)
    {
        if (hint) {
            hints.Add("This is a custom feat"); // ๅฏ้€‰
        } else {
            // ไฟฎๆ”นๅฑžๆ€งใ€่ฎพ็ฝฎๆฝœๅŠ›ใ€ๅบ”็”จๆ•ˆๆžœ็ญ‰
            // ๅชๆœ‰ๅœจไธๆ˜ฏ hint ๆจกๅผๆ—ถๆ‰ๆ‰ง่กŒ่ฟ™ไบ›
            eleOwner.ModBase(SKILL.life, add * 15);
            eleOwner.ModPotential(SKILL.DEX, add * 2);
            // ๅ…ถไป–ๅ†…ๅฎน
        }
    }
}

่ฟ™ๅนถไธ่ฆๆฑ‚ๅผ•็”จ CustomWhateverLoader.dllใ€‚

ๅ›พๆ ‡ โ€‹

่‡ชๅฎšไน‰ไธ“้•ฟ่ฟ˜ๅฏไปฅๆ‹ฅๆœ‰่‡ชๅฎšไน‰ๅ›พๆ ‡๏ผŒๆ‚จ็š„ๅ›พๆ ‡้œ€่ฆๆ”พ็ฝฎๅœจ Texture ๆ–‡ไปถๅคนไธญ๏ผŒไฝฟ็”จไธŽ alias ็›ธๅŒ็š„ๆ–‡ไปถๅ๏ผŒไพ‹ๅฆ‚ featMyExample.pngใ€‚็„ถๅŽ้‡ๅ†™ GetIcon ๆ–นๆณ•๏ผŒๅฐ†ๅ›พๆ ‡้‡ๅฎšๅ‘ๅˆฐ่ฏฅๅ›พๆ ‡๏ผš

cs
internal class FeatMyExample : Feat
{
    public override Sprite GetIcon(string suffix = "") 
    { 
        return SpriteSheet.Get(source.alias); 
    } 
}

ๅฆ‚ๆžœ็บน็†ๅคงๅฐไธๆ˜ฏ32x32๏ผŒCWLไผšๅฐ†ๅ…ถ่ฐƒๆ•ดไธบ32x32ใ€‚

่‡ชๅŠจ่Žทๅ– โ€‹

ไฝฟ็”จๆ ‡็ญพ addEleOnLoad๏ผŒ็ŽฉๅฎถๅœจๅŠ ่ฝฝๆ—ถๅฐ†่‡ชๅŠจ่Žทๅพ—่ฟ™ไธชไธ“้•ฟใ€‚

This project is an unofficial documentation site and is not affiliated with, endorsed by, or associated with Elin or Lafrontier / Noa. All trademarks are the property of their respective owners.