koishi-plugin-interactive
Version:
多功能互动型QQ机器人插件,支持猜数字、每日签到、幸运抽奖、积分商店、排行榜、成就系统、个人资料、随机互动、将军系统、修仙系统、每日提醒等功能
982 lines (981 loc) • 109 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyXiuXianSystem = applyXiuXianSystem;
const lingGenData = [
{ name: '金天灵根', type: '天灵根', cultivationSpeed: 2.5, attack: 0.3, defense: 0.2, speed: 0.15, control: 0.1, breakthroughBonus: 1.0 },
{ name: '木天灵根', type: '天灵根', cultivationSpeed: 2.5, attack: 0.3, defense: 0.2, speed: 0.15, control: 0.1, breakthroughBonus: 1.0 },
{ name: '水天灵根', type: '天灵根', cultivationSpeed: 2.5, attack: 0.3, defense: 0.2, speed: 0.15, control: 0.1, breakthroughBonus: 1.0 },
{ name: '火天灵根', type: '天灵根', cultivationSpeed: 2.5, attack: 0.3, defense: 0.2, speed: 0.15, control: 0.1, breakthroughBonus: 1.0 },
{ name: '土天灵根', type: '天灵根', cultivationSpeed: 2.5, attack: 0.3, defense: 0.2, speed: 0.15, control: 0.1, breakthroughBonus: 1.0 },
{ name: '隐暗灵根', type: '隐灵根', cultivationSpeed: 2.8, attack: 0.35, defense: 0.15, speed: 0.25, control: 0.2, breakthroughBonus: 0.2 },
{ name: '隐雷灵根', type: '隐灵根', cultivationSpeed: 2.8, attack: 0.35, defense: 0.15, speed: 0.25, control: 0.2, breakthroughBonus: 0.2 },
{ name: '变异雷灵根', type: '变异灵根', cultivationSpeed: 2.3, attack: 0.4, defense: 0.1, speed: 0.25, control: 0.15, breakthroughBonus: 0.2 },
{ name: '变异冰灵根', type: '变异灵根', cultivationSpeed: 2.2, attack: 0.25, defense: 0.3, speed: 0.1, control: 0.3, breakthroughBonus: 0.15 },
{ name: '变异风灵根', type: '变异灵根', cultivationSpeed: 2.4, attack: 0.15, defense: 0.1, speed: 0.4, control: 0.1, breakthroughBonus: 0.1 },
{ name: '变异暗灵根', type: '变异灵根', cultivationSpeed: 2.3, attack: 0.35, defense: 0.05, speed: 0.3, control: 0.25, breakthroughBonus: 0.15 },
{ name: '变异光灵根', type: '变异灵根', cultivationSpeed: 2.2, attack: 0.2, defense: 0.25, speed: 0.2, control: 0.35, breakthroughBonus: 0.1 },
{ name: '金木双灵根', type: '双灵根', cultivationSpeed: 1.5, attack: 0.15, defense: 0.15, speed: 0.1, control: 0.1, breakthroughBonus: 0.1 },
{ name: '水火双灵根', type: '双灵根', cultivationSpeed: 1.5, attack: 0.15, defense: 0.15, speed: 0.1, control: 0.1, breakthroughBonus: 0.1 },
{ name: '土木双灵根', type: '双灵根', cultivationSpeed: 1.5, attack: 0.15, defense: 0.15, speed: 0.1, control: 0.1, breakthroughBonus: 0.1 },
{ name: '金火双灵根', type: '双灵根', cultivationSpeed: 1.5, attack: 0.15, defense: 0.15, speed: 0.1, control: 0.1, breakthroughBonus: 0.1 },
{ name: '水木双灵根', type: '双灵根', cultivationSpeed: 1.5, attack: 0.15, defense: 0.15, speed: 0.1, control: 0.1, breakthroughBonus: 0.1 },
{ name: '金木水三灵根', type: '三灵根', cultivationSpeed: 1.2, attack: 0.1, defense: 0.1, speed: 0.05, control: 0.05, breakthroughBonus: 0.05 },
{ name: '水火土三灵根', type: '三灵根', cultivationSpeed: 1.2, attack: 0.1, defense: 0.1, speed: 0.05, control: 0.05, breakthroughBonus: 0.05 },
{ name: '木火土三灵根', type: '三灵根', cultivationSpeed: 1.2, attack: 0.1, defense: 0.1, speed: 0.05, control: 0.05, breakthroughBonus: 0.05 },
{ name: '金水土三灵根', type: '三灵根', cultivationSpeed: 1.2, attack: 0.1, defense: 0.1, speed: 0.05, control: 0.05, breakthroughBonus: 0.05 },
{ name: '金火木三灵根', type: '三灵根', cultivationSpeed: 1.2, attack: 0.1, defense: 0.1, speed: 0.05, control: 0.05, breakthroughBonus: 0.05 },
{ name: '四灵根', type: '四灵根', cultivationSpeed: 0.8, attack: -0.1, defense: -0.05, speed: -0.05, control: -0.05, breakthroughBonus: -0.2 },
{ name: '五灵根', type: '五灵根', cultivationSpeed: 0.5, attack: -0.2, defense: -0.1, speed: -0.1, control: -0.1, breakthroughBonus: -0.3 }
];
const specialBodyData = [
{ name: '龙吟之体', cultivationSpeed: 1.5, specialAbility: '阴阳术法', description: '男体错生女儿身,天生阴阳失衡,修炼快但需特殊功法调节' },
{ name: '通玉凤髓之体', cultivationSpeed: 1.3, specialAbility: '灵气生成', description: '体内能产生先天灵气,修炼事半功倍,可辅助他人修炼' },
{ name: '纯阴之体', cultivationSpeed: 1.4, specialAbility: '阴系法术', description: '体质阴,天生寒冷,修炼阴系功法速度极快' },
{ name: '纯阳之体', cultivationSpeed: 1.4, specialAbility: '阳系法术', description: '体质阳,天生燥热,修炼阳系功法威力巨大' },
{ name: '先天道体', cultivationSpeed: 2.0, specialAbility: '法则感悟', description: '天生与道相亲,感悟天地法则能力强,万年难遇' },
{ name: '混沌之体', cultivationSpeed: 1.8, specialAbility: '全系功法', description: '体质包容万物,可修炼任何功法,传说中的体质' },
{ name: '剑灵之体', cultivationSpeed: 1.3, specialAbility: '剑系法术', description: '天生与剑有缘,修炼剑系功法威力加倍' },
{ name: '丹灵之体', cultivationSpeed: 1.2, specialAbility: '炼丹加成', description: '对丹药有特殊感应,炼丹成功率大幅提升' }
];
const elementRelations = {
'金': { advantage: ['木'], disadvantage: ['火', '雷'] },
'木': { advantage: ['土'], disadvantage: ['金', '风'] },
'水': { advantage: ['火'], disadvantage: ['土', '冰'] },
'火': { advantage: ['金', '雷'], disadvantage: ['水', '冰'] },
'土': { advantage: ['水'], disadvantage: ['木', '风'] },
'雷': { advantage: ['水', '金'], disadvantage: ['土', '风'] },
'风': { advantage: ['火', '雷'], disadvantage: ['土', '金'] },
'冰': { advantage: ['火', '风'], disadvantage: ['水', '雷'] },
'光': { advantage: ['暗'], disadvantage: ['暗'] },
'暗': { advantage: ['光'], disadvantage: ['光'] },
'阴': { advantage: ['阳'], disadvantage: ['阳'] },
'阳': { advantage: ['阴'], disadvantage: ['阴'] }
};
const skillData = [
{ id: 'skill_gold_1', name: '金光指', description: '一品金系功法,永久提升金系属性', level: 1, element: '金', effect: { type: 'attribute', value: 5 }, learned: false, price: 10000 },
{ id: 'skill_wood_1', name: '木灵诀', description: '一品木系功法,永久提升木系属性', level: 1, element: '木', effect: { type: 'attribute', value: 5 }, learned: false, price: 10000 },
{ id: 'skill_water_1', name: '水流心法', description: '一品水系功法,永久提升水系属性', level: 1, element: '水', effect: { type: 'attribute', value: 5 }, learned: false, price: 10000 },
{ id: 'skill_fire_1', name: '火焰心经', description: '一品火系功法,永久提升火系属性', level: 1, element: '火', effect: { type: 'attribute', value: 5 }, learned: false, price: 10000 },
{ id: 'skill_earth_1', name: '土灵诀', description: '一品土系功法,永久提升土系属性', level: 1, element: '土', effect: { type: 'attribute', value: 5 }, learned: false, price: 10000 },
{ id: 'skill_thunder_2', name: '惊雷诀', description: '二品雷系功法,永久提升雷系属性', level: 2, element: '雷', effect: { type: 'attribute', value: 8 }, learned: false, price: 50000 },
{ id: 'skill_wind_2', name: '清风诀', description: '二品风系功法,永久提升风系属性', level: 2, element: '风', effect: { type: 'attribute', value: 8 }, learned: false, price: 50000 },
{ id: 'skill_ice_2', name: '寒冰诀', description: '二品冰系功法,永久提升冰系属性', level: 2, element: '冰', effect: { type: 'attribute', value: 8 }, learned: false, price: 50000 },
{ id: 'skill_thunder_3', name: '雷霆万钧', description: '三品雷系功法,永久提升雷系属性', level: 3, element: '雷', effect: { type: 'attribute', value: 12 }, learned: false, price: 150000 },
{ id: 'skill_wind_3', name: '御风诀', description: '三品风系功法,永久提升风系属性', level: 3, element: '风', effect: { type: 'attribute', value: 12 }, learned: false, price: 150000 },
{ id: 'skill_light_3', name: '光明诀', description: '三品光系功法,永久提升光系属性', level: 3, element: '光', effect: { type: 'attribute', value: 12 }, learned: false, price: 150000 },
{ id: 'skill_dark_3', name: '暗影诀', description: '三品暗系功法,永久提升暗系属性', level: 3, element: '暗', effect: { type: 'attribute', value: 12 }, learned: false, price: 150000 },
{ id: 'skill_gold_4', name: '金刚不坏功', description: '四品金系防御功法,大幅提升防御力', level: 4, element: '金', effect: { type: 'defense', value: 0.15 }, learned: false, price: 400000 },
{ id: 'skill_wood_4', name: '长春功', description: '四品木系恢复功法,提升生命恢复速度', level: 4, element: '木', effect: { type: 'recovery', value: 0.1 }, learned: false, price: 400000 },
{ id: 'skill_water_4', name: '玄水真经', description: '四品水系功法,提升水系法术威力', level: 4, element: '水', effect: { type: 'attack', value: 0.15 }, learned: false, price: 400000 },
{ id: 'skill_fire_4', name: '烈火真经', description: '四品火系功法,提升火系法术威力', level: 4, element: '火', effect: { type: 'attack', value: 0.15 }, learned: false, price: 400000 },
{ id: 'skill_earth_4', name: '大地真经', description: '四品土系防御功法,大幅提升防御力', level: 4, element: '土', effect: { type: 'defense', value: 0.15 }, learned: false, price: 400000 },
{ id: 'skill_thunder_5', name: '五雷正法', description: '五品雷系攻击功法,大幅提升雷系法术威力', level: 5, element: '雷', effect: { type: 'attack', value: 0.2 }, learned: false, price: 800000 },
{ id: 'skill_wind_5', name: '神风诀', description: '五品风系身法,大幅提升速度', level: 5, element: '风', effect: { type: 'speed', value: 0.2 }, learned: false, price: 800000 },
{ id: 'skill_ice_5', name: '玄冰诀', description: '五品冰系控制功法,提升控制能力', level: 5, element: '冰', effect: { type: 'control', value: 0.2 }, learned: false, price: 800000 },
{ id: 'skill_light_5', name: '圣光术', description: '五品光系辅助功法,提升治疗效果', level: 5, element: '光', effect: { type: 'recovery', value: 0.2 }, learned: false, price: 800000 },
{ id: 'skill_dark_5', name: '幽冥诀', description: '五品暗系攻击功法,提升暗系法术威力', level: 5, element: '暗', effect: { type: 'attack', value: 0.2 }, learned: false, price: 800000 },
{ id: 'skill_gold_6', name: '万剑归宗', description: '六品金系顶级剑诀,大幅提升攻击力', level: 6, element: '金', effect: { type: 'attack', value: 0.25 }, learned: false, price: 1500000 },
{ id: 'skill_wood_6', name: '青木长生诀', description: '木系顶级功法,大幅提升生命力和恢复速度', level: 6, element: '木', effect: { type: 'recovery', value: 0.25 }, learned: false, price: 1500000 },
{ id: 'skill_water_6', name: '玄元重水诀', description: '水系顶级功法,大幅提升水系法术威力', level: 6, element: '水', effect: { type: 'attack', value: 0.25 }, learned: false, price: 1500000 },
{ id: 'skill_fire_6', name: '九阳神功', description: '火系顶级功法,大幅提升火系法术威力', level: 6, element: '火', effect: { type: 'attack', value: 0.25 }, learned: false, price: 1500000 },
{ id: 'skill_earth_6', name: '厚土诀', description: '土系顶级防御功法,大幅提升防御力', level: 6, element: '土', effect: { type: 'defense', value: 0.25 }, learned: false, price: 1500000 },
{ id: 'skill_light_6', name: '太阳真经', description: '光系顶级功法,永久提升光系属性', level: 6, element: '光', effect: { type: 'attribute', value: 25 }, learned: false, price: 1500000 },
{ id: 'skill_dark_6', name: '太阴真经', description: '暗系顶级功法,永久提升暗系属性', level: 6, element: '暗', effect: { type: 'attribute', value: 25 }, learned: false, price: 1500000 },
{ id: 'skill_ice_6', name: '冰心诀', description: '冰系顶级功法,永久提升冰系属性', level: 6, element: '冰', effect: { type: 'attribute', value: 25 }, learned: false, price: 1500000 },
{ id: 'skill_thunder_7', name: '紫霄神雷', description: '七品雷系至高功法,大幅提升雷系属性', level: 7, element: '雷', effect: { type: 'attribute', value: 35 }, learned: false, price: 3000000 },
{ id: 'skill_wind_7', name: '九天御风诀', description: '七品风系至高身法,大幅提升速度', level: 7, element: '风', effect: { type: 'speed', value: 0.3 }, learned: false, price: 3000000 },
{ id: 'skill_yin_7', name: '玄阴真经', description: '七品阴系至高功法,大幅提升阴系属性', level: 7, element: '阴', effect: { type: 'attribute', value: 35 }, learned: false, price: 3000000 },
{ id: 'skill_yang_7', name: '纯阳真经', description: '七品阳系至高功法,大幅提升阳系属性', level: 7, element: '阳', effect: { type: 'attribute', value: 35 }, learned: false, price: 3000000 },
{ id: 'skill_elemental_8', name: '五行衍天诀', description: '八品五行融合功法,全面提升五行属性', level: 8, element: '全', effect: { type: 'attribute', value: 20 }, learned: false, price: 7500000 },
{ id: 'skill_space_8', name: '虚空遁术', description: '八品空间系身法,大幅提升闪避能力', level: 8, element: '空间', effect: { type: 'speed', value: 0.4 }, learned: false, price: 7500000 },
{ id: 'skill_time_8', name: '时光流转诀', description: '八品时间系功法,提升修炼速度', level: 8, element: '时间', effect: { type: 'cultivation', value: 0.2 }, learned: false, price: 7500000 },
{ id: 'skill_chaos_9', name: '混沌真经', description: '九品混沌系至高功法,全面提升所有属性', level: 9, element: '混沌', effect: { type: 'attribute', value: 50 }, learned: false, price: 20000000 },
{ id: 'skill_dao_9', name: '大道真解', description: '九品大道级功法,大幅提升突破成功率', level: 9, element: '道', effect: { type: 'breakthrough', value: 0.3 }, learned: false, price: 20000000 },
{ id: 'skill_creation_9', name: '创世神诀', description: '九品创世级功法,全面提升所有能力', level: 9, element: '创世', effect: { type: 'all', value: 0.2 }, learned: false, price: 50000000 }
];
const pillData = [
{ id: 'speed_pill_1', name: '聚灵丹', description: '提升修炼速度10%,持续24小时', level: 1, effect: { type: 'cultivationSpeed', value: 0.1, duration: 86400 }, count: 0, price: 10000 },
{ id: 'speed_pill_3', name: '凝元丹', description: '提升修炼速度20%,持续24小时', level: 3, effect: { type: 'cultivationSpeed', value: 0.2, duration: 86400 }, count: 0, price: 50000 },
{ id: 'speed_pill_6', name: '聚元丹', description: '提升修炼速度30%,持续24小时', level: 6, effect: { type: 'cultivationSpeed', value: 0.3, duration: 86400 }, count: 0, price: 200000 },
{ id: 'speed_pill_9', name: '太一聚灵丹', description: '提升修炼速度50%,持续24小时', level: 9, effect: { type: 'cultivationSpeed', value: 0.5, duration: 86400 }, count: 0, price: 1000000 },
{ id: 'attack_pill_2', name: '淬体丹', description: '提升攻击力10%,持续12小时', level: 2, effect: { type: 'attack', value: 0.1, duration: 43200 }, count: 0, price: 30000 },
{ id: 'attack_pill_5', name: '煅骨丹', description: '提升攻击力20%,持续12小时', level: 5, effect: { type: 'attack', value: 0.2, duration: 43200 }, count: 0, price: 150000 },
{ id: 'attack_pill_8', name: '金刚丹', description: '提升攻击力40%,持续12小时', level: 8, effect: { type: 'attack', value: 0.4, duration: 43200 }, count: 0, price: 800000 },
{ id: 'attack_pill_9', name: '诛仙丹', description: '提升攻击力60%,持续12小时', level: 9, effect: { type: 'attack', value: 0.6, duration: 43200 }, count: 0, price: 2000000 },
{ id: 'defense_pill_2', name: '固元丹', description: '提升防御力10%,持续12小时', level: 2, effect: { type: 'defense', value: 0.1, duration: 43200 }, count: 0, price: 30000 },
{ id: 'defense_pill_5', name: '玄铁丹', description: '提升防御力20%,持续12小时', level: 5, effect: { type: 'defense', value: 0.2, duration: 43200 }, count: 0, price: 150000 },
{ id: 'defense_pill_8', name: '金身丹', description: '提升防御力40%,持续12小时', level: 8, effect: { type: 'defense', value: 0.4, duration: 43200 }, count: 0, price: 800000 },
{ id: 'defense_pill_9', name: '不灭丹', description: '提升防御力60%,持续12小时', level: 9, effect: { type: 'defense', value: 0.6, duration: 43200 }, count: 0, price: 2000000 },
{ id: 'speed_boost_pill_2', name: '轻身丹', description: '提升速度10%,持续12小时', level: 2, effect: { type: 'speed', value: 0.1, duration: 43200 }, count: 0, price: 30000 },
{ id: 'speed_boost_pill_5', name: '御风丹', description: '提升速度20%,持续12小时', level: 5, effect: { type: 'speed', value: 0.2, duration: 43200 }, count: 0, price: 150000 },
{ id: 'speed_boost_pill_8', name: '疾风丹', description: '提升速度40%,持续12小时', level: 8, effect: { type: 'speed', value: 0.4, duration: 43200 }, count: 0, price: 800000 },
{ id: 'speed_boost_pill_9', name: '神行丹', description: '提升速度60%,持续12小时', level: 9, effect: { type: 'speed', value: 0.6, duration: 43200 }, count: 0, price: 2000000 },
{ id: 'control_pill_2', name: '凝神丹', description: '提升控制力10%,持续12小时', level: 2, effect: { type: 'control', value: 0.1, duration: 43200 }, count: 0, price: 30000 },
{ id: 'control_pill_5', name: '定心丹', description: '提升控制力20%,持续12小时', level: 5, effect: { type: 'control', value: 0.2, duration: 43200 }, count: 0, price: 150000 },
{ id: 'control_pill_8', name: '玄心丹', description: '提升控制力40%,持续12小时', level: 8, effect: { type: 'control', value: 0.4, duration: 43200 }, count: 0, price: 800000 },
{ id: 'control_pill_9', name: '天心丹', description: '提升控制力60%,持续12小时', level: 9, effect: { type: 'control', value: 0.6, duration: 43200 }, count: 0, price: 2000000 },
{ id: 'breakthrough_pill_3', name: '洗髓丹', description: '提升突破成功率10%', level: 3, effect: { type: 'breakthroughBonus', value: 0.1 }, count: 0, price: 100000 },
{ id: 'breakthrough_pill_6', name: '易经丹', description: '提升突破成功率25%', level: 6, effect: { type: 'breakthroughBonus', value: 0.25 }, count: 0, price: 500000 },
{ id: 'breakthrough_pill_9', name: '天命丹', description: '提升突破成功率50%', level: 9, effect: { type: 'breakthroughBonus', value: 0.5 }, count: 0, price: 2000000 },
{ id: 'realm_pill_7', name: '破境丹', description: '直接提升一个小境界', level: 7, effect: { type: 'realmAdvance', value: 1 }, count: 0, price: 3000000 },
{ id: 'realm_pill_9', name: '飞升丹', description: '直接提升一个大境界', level: 9, effect: { type: 'realmAdvance', value: 4 }, count: 0, price: 15000000 },
{ id: 'cultivation_pill_1', name: '培元丹', description: '增加100点修为', level: 1, effect: { type: 'cultivation', value: 100 }, count: 0, price: 10000 },
{ id: 'cultivation_pill_4', name: '蕴灵丹', description: '增加500点修为', level: 4, effect: { type: 'cultivation', value: 500 }, count: 0, price: 80000 },
{ id: 'cultivation_pill_7', name: '聚灵丹', description: '增加2000点修为', level: 7, effect: { type: 'cultivation', value: 2000 }, count: 0, price: 500000 },
{ id: 'cultivation_pill_9', name: '太上还元丹', description: '增加10000点修为', level: 9, effect: { type: 'cultivation', value: 10000 }, count: 0, price: 3000000 },
{ id: 'attribute_pill_gold', name: '金元丹', description: '永久提升金系属性5点', level: 3, effect: { type: 'attribute_gold', value: 5 }, count: 0, price: 150000 },
{ id: 'attribute_pill_wood', name: '木元丹', description: '永久提升木系属性5点', level: 3, effect: { type: 'attribute_wood', value: 5 }, count: 0, price: 150000 },
{ id: 'attribute_pill_water', name: '水元丹', description: '永久提升水系属性5点', level: 3, effect: { type: 'attribute_water', value: 5 }, count: 0, price: 150000 },
{ id: 'attribute_pill_fire', name: '火元丹', description: '永久提升火系属性5点', level: 3, effect: { type: 'attribute_fire', value: 5 }, count: 0, price: 150000 },
{ id: 'attribute_pill_earth', name: '土元丹', description: '永久提升土系属性5点', level: 3, effect: { type: 'attribute_earth', value: 5 }, count: 0, price: 150000 },
{ id: 'attribute_pill_all_6', name: '天元丹', description: '永久提升全属性10点', level: 6, effect: { type: 'attribute_all', value: 10 }, count: 0, price: 1000000 },
{ id: 'attribute_pill_all_9', name: '混沌元丹', description: '永久提升全属性30点', level: 9, effect: { type: 'attribute_all', value: 30 }, count: 0, price: 5000000 },
{ id: 'special_pill_7', name: '补天丹', description: '洗炼灵根,提升灵根品质', level: 7, effect: { type: 'linggenUpgrade', value: 1 }, count: 0, price: 5000000 },
{ id: 'special_pill_9', name: '九转金丹', description: '重塑肉身,有机会获得特殊体质', level: 9, effect: { type: 'specialBody', value: 1 }, count: 0, price: 20000000 }
];
const realmData = [
// 人界修仙境界
{ name: '炼气期', world: '人界', stages: ['初级', '中级', '后期', '大圆满'], cultivationRequired: 100, breakthroughDifficulty: 1.0 },
{ name: '筑基期', world: '人界', stages: ['初级', '中级', '后期', '大圆满'], cultivationRequired: 500, breakthroughDifficulty: 1.2 },
{ name: '结丹期', world: '人界', stages: ['初级', '中级', '后期', '大圆满'], cultivationRequired: 2000, breakthroughDifficulty: 1.5 },
{ name: '元婴期', world: '人界', stages: ['初级', '中级', '后期', '大圆满'], cultivationRequired: 8000, breakthroughDifficulty: 1.8 },
{ name: '化神期', world: '人界', stages: ['初级', '中级', '后期', '大圆满'], cultivationRequired: 20000, breakthroughDifficulty: 2.0 },
// 灵界修仙境界
{ name: '炼虚期', world: '灵界', stages: ['初级', '中级', '后期', '大圆满'], cultivationRequired: 50000, breakthroughDifficulty: 2.2 },
{ name: '合体期', world: '灵界', stages: ['初级', '中级', '后期', '大圆满'], cultivationRequired: 100000, breakthroughDifficulty: 2.5 },
{ name: '大乘期', world: '灵界', stages: ['初级', '中级', '后期', '大圆满'], cultivationRequired: 200000, breakthroughDifficulty: 2.8 },
{ name: '渡劫期', world: '灵界', stages: ['初级', '中级', '后期', '大圆满'], cultivationRequired: 400000, breakthroughDifficulty: 3.0 },
// 仙界修仙境界
{ name: '真仙', world: '仙界', stages: ['初级', '中级', '后期', '大圆满'], cultivationRequired: 800000, breakthroughDifficulty: 3.5 },
{ name: '玄仙', world: '仙界', stages: ['初级', '中级', '后期', '大圆满'], cultivationRequired: 1500000, breakthroughDifficulty: 4.0 },
{ name: '金仙', world: '仙界', stages: ['初级', '中级', '后期', '大圆满'], cultivationRequired: 3000000, breakthroughDifficulty: 4.5 },
{ name: '仙尊', world: '仙界', stages: ['初级', '中级', '后期', '大圆满'], cultivationRequired: 6000000, breakthroughDifficulty: 5.0 }
];
const monsterData = [
{
id: 'monster_qi_1',
name: '炼气期妖兽',
realm: '炼气期',
stage: '初级',
level: 5,
health: 1000,
maxHealth: 1000,
attack: 150,
defense: 50,
speed: 80,
control: 50,
element: '土',
expReward: 10,
pointsReward: 5000,
dropItems: [
{ type: 'pill', id: 'speed_pill_1', chance: 0.1 },
{ type: 'pill', id: 'cultivation_pill_1', chance: 0.1 },
{ type: 'points', amount: 1000, chance: 0.8 }
],
description: '初入仙途的修行者最常见的对手,实力较弱但数量众多。'
},
{
id: 'monster_qi_2',
name: '炼气期魔物',
realm: '炼气期',
stage: '中级',
level: 10,
health: 1500,
maxHealth: 1500,
attack: 200,
defense: 80,
speed: 100,
control: 100,
element: '火',
expReward: 15,
pointsReward: 8000,
dropItems: [
{ type: 'pill', id: 'speed_pill_1', chance: 0.2 },
{ type: 'pill', id: 'cultivation_pill_1', chance: 0.2 },
{ type: 'points', amount: 1500, chance: 0.6 }
],
description: '炼气中期的魔物,比普通妖兽更为强大。'
},
{
id: 'monster_zhu_1',
name: '筑基期灵兽',
realm: '筑基期',
stage: '初级',
level: 15,
health: 2500,
maxHealth: 2500,
attack: 300,
defense: 150,
speed: 120,
control: 150,
element: '火',
expReward: 25,
pointsReward: 15000,
dropItems: [
{ type: 'skill', id: 'skill_gold_1', chance: 0.05 },
{ type: 'skill', id: 'skill_wood_1', chance: 0.05 },
{ type: 'skill', id: 'skill_water_1', chance: 0.05 },
{ type: 'skill', id: 'skill_fire_1', chance: 0.05 },
{ type: 'skill', id: 'skill_earth_1', chance: 0.05 },
{ type: 'points', amount: 3000, chance: 0.75 }
],
description: '筑基期修士的试炼对象,具有一定的战斗能力。'
},
{
id: 'monster_zhu_2',
name: '筑基期妖将',
realm: '筑基期',
stage: '中级',
level: 20,
health: 3500,
maxHealth: 3500,
attack: 400,
defense: 200,
speed: 150,
control: 200,
element: '金',
expReward: 35,
pointsReward: 20000,
dropItems: [
{ type: 'skill', id: 'skill_gold_1', chance: 0.1 },
{ type: 'skill', id: 'skill_wood_1', chance: 0.1 },
{ type: 'skill', id: 'skill_water_1', chance: 0.1 },
{ type: 'skill', id: 'skill_fire_1', chance: 0.1 },
{ type: 'skill', id: 'skill_earth_1', chance: 0.1 },
{ type: 'points', amount: 4000, chance: 0.5 }
],
description: '筑基中期的妖将,统领着一群小妖。'
},
{
id: 'monster_jie_1',
name: '结丹期妖王',
realm: '结丹期',
stage: '初级',
level: 30,
health: 6000,
maxHealth: 6000,
attack: 600,
defense: 300,
speed: 180,
control: 300,
element: '雷',
expReward: 50,
pointsReward: 50000,
dropItems: [
{ type: 'pill', id: 'attack_pill_2', chance: 0.05 },
{ type: 'pill', id: 'defense_pill_2', chance: 0.05 },
{ type: 'pill', id: 'speed_boost_pill_2', chance: 0.05 },
{ type: 'pill', id: 'control_pill_2', chance: 0.05 },
{ type: 'skill', id: 'skill_thunder_2', chance: 0.05 },
{ type: 'skill', id: 'skill_wind_2', chance: 0.05 },
{ type: 'skill', id: 'skill_ice_2', chance: 0.05 },
{ type: 'points', amount: 10000, chance: 0.65 }
],
description: '结丹期的强大妖兽,拥有操控雷电的能力,实力不容小觑。'
},
{
id: 'monster_jie_2',
name: '结丹期魔君',
realm: '结丹期',
stage: '中级',
level: 40,
health: 8000,
maxHealth: 8000,
attack: 750,
defense: 400,
speed: 200,
control: 400,
element: '暗',
expReward: 70,
pointsReward: 70000,
dropItems: [
{ type: 'pill', id: 'attack_pill_2', chance: 0.1 },
{ type: 'pill', id: 'defense_pill_2', chance: 0.1 },
{ type: 'pill', id: 'speed_boost_pill_2', chance: 0.1 },
{ type: 'pill', id: 'control_pill_2', chance: 0.1 },
{ type: 'skill', id: 'skill_thunder_2', chance: 0.1 },
{ type: 'skill', id: 'skill_wind_2', chance: 0.1 },
{ type: 'skill', id: 'skill_ice_2', chance: 0.1 },
{ type: 'points', amount: 30000, chance: 0.3 }
],
description: '结丹中期的魔道君主,修炼黑暗法术,心狠手辣。'
},
{
id: 'monster_yuan_1',
name: '元婴期老怪',
realm: '元婴期',
stage: '初级',
level: 50,
health: 12000,
maxHealth: 12000,
attack: 1000,
defense: 600,
speed: 250,
control: 600,
element: '冰',
expReward: 100,
pointsReward: 200000,
dropItems: [
{ type: 'pill', id: 'speed_pill_3', chance: 0.05 },
{ type: 'pill', id: 'breakthrough_pill_3', chance: 0.05 },
{ type: 'pill', id: 'attribute_pill_3', chance: 0.05 },
{ type: 'skill', id: 'skill_thunder_3', chance: 0.05 },
{ type: 'skill', id: 'skill_wind_3', chance: 0.05 },
{ type: 'skill', id: 'skill_light_3', chance: 0.05 },
{ type: 'skill', id: 'skill_dark_3', chance: 0.05 },
{ type: 'points', amount: 50000, chance: 0.65 }
],
description: '元婴期的老怪物,修炼多年,掌握强大的冰系法术。'
},
{
id: 'monster_yuan_2',
name: '元婴期妖尊',
realm: '元婴期',
stage: '中级',
level: 60,
health: 15000,
maxHealth: 15000,
attack: 1200,
defense: 750,
speed: 280,
control: 800,
element: '风',
expReward: 130,
pointsReward: 250000,
dropItems: [
{ type: 'pill', id: 'speed_boost_pill_3', chance: 0.1 },
{ type: 'pill', id: 'breakthrough_pill_3', chance: 0.1 },
{ type: 'pill', id: 'attribute_pill_3', chance: 0.1 },
{ type: 'skill', id: 'skill_thunder_3', chance: 0.1 },
{ type: 'skill', id: 'skill_wind_3', chance: 0.1 },
{ type: 'skill', id: 'skill_light_3', chance: 0.1 },
{ type: 'skill', id: 'skill_dark_3', chance: 0.1 },
{ type: 'points', amount: 70000, chance: 0.3 }
],
description: '元婴中期的妖尊,速度极快,擅长风系法术。'
},
{
id: 'monster_hua_1',
name: '化神期魔尊',
realm: '化神期',
stage: '初级',
level: 70,
health: 25000,
maxHealth: 25000,
attack: 1800,
defense: 1200,
speed: 350,
control: 1200,
element: '暗',
expReward: 200,
pointsReward: 500000,
dropItems: [
{ type: 'pill', id: 'cultivation_pill_4', chance: 0.05 },
{ type: 'skill', id: 'skill_gold_4', chance: 0.05 },
{ type: 'skill', id: 'skill_wood_4', chance: 0.05 },
{ type: 'skill', id: 'skill_water_4', chance: 0.05 },
{ type: 'skill', id: 'skill_fire_4', chance: 0.05 },
{ type: 'skill', id: 'skill_earth_4', chance: 0.05 },
{ type: 'points', amount: 90000, chance: 0.7 }
],
description: '化神期的魔道尊者,修炼黑暗法术,实力极为恐怖。'
},
{
id: 'monster_hua_2',
name: '化神期仙兽',
realm: '化神期',
stage: '中级',
level: 80,
health: 30000,
maxHealth: 30000,
attack: 2200,
defense: 1500,
speed: 400,
control: 1500,
element: '光',
expReward: 250,
pointsReward: 600000,
dropItems: [
{ type: 'pill', id: 'cultivation_pill_4', chance: 0.1 },
{ type: 'skill', id: 'skill_gold_4', chance: 0.1 },
{ type: 'skill', id: 'skill_wood_4', chance: 0.1 },
{ type: 'skill', id: 'skill_water_4', chance: 0.1 },
{ type: 'skill', id: 'skill_fire_4', chance: 0.1 },
{ type: 'skill', id: 'skill_earth_4', chance: 0.1 },
{ type: 'points', amount: 110000, chance: 0.4 }
],
description: '化神中期的仙兽,拥有神圣的光明力量,极为稀有。'
},
{
id: 'monster_lian_1',
name: '炼虚期天魔',
realm: '炼虚期',
stage: '初级',
level: 85,
health: 40000,
maxHealth: 40000,
attack: 2800,
defense: 1800,
speed: 450,
control: 2000,
element: '暗',
expReward: 350,
pointsReward: 800000,
dropItems: [
{ type: 'pill', id: 'attack_pill_5', chance: 0.05 },
{ type: 'pill', id: 'defense_pill_5', chance: 0.05 },
{ type: 'pill', id: 'speed_boost_pill_5', chance: 0.05 },
{ type: 'pill', id: 'control_pill_5', chance: 0.05 },
{ type: 'skill', id: 'skill_thunder_5', chance: 0.05 },
{ type: 'skill', id: 'skill_wind_5', chance: 0.05 },
{ type: 'skill', id: 'skill_ice_5', chance: 0.05 },
{ type: 'skill', id: 'skill_light_5', chance: 0.05 },
{ type: 'skill', id: 'skill_dark_5', chance: 0.05 },
{ type: 'points', amount: 150000, chance: 0.55 }
],
description: '炼虚期的天魔,来自魔界深处,实力深不可测。'
},
{
id: 'monster_he_1',
name: '合体期神兽',
realm: '合体期',
stage: '初级',
level: 90,
health: 50000,
maxHealth: 50000,
attack: 3500,
defense: 2200,
speed: 500,
control: 2500,
element: '雷',
expReward: 450,
pointsReward: 1000000,
dropItems: [
{ type: 'pill', id: 'speed_pill_6', chance: 0.05 },
{ type: 'pill', id: 'breakthrough_pill_6', chance: 0.05 },
{ type: 'pill', id: 'attribute_pill_6', chance: 0.05 },
{ type: 'skill', id: 'skill_gold_6', chance: 0.05 },
{ type: 'skill', id: 'skill_wood_6', chance: 0.05 },
{ type: 'skill', id: 'skill_water_6', chance: 0.05 },
{ type: 'skill', id: 'skill_fire_6', chance: 0.05 },
{ type: 'skill', id: 'skill_earth_6', chance: 0.05 },
{ type: 'skill', id: 'skill_light_6', chance: 0.05 },
{ type: 'skill', id: 'skill_dark_6', chance: 0.05 },
{ type: 'skill', id: 'skill_ice_6', chance: 0.05 },
{ type: 'points', amount: 200000, chance: 0.45 }
],
description: '合体期的神兽,拥有上古血脉,掌握天雷之力。'
},
{
id: 'monster_da_1',
name: '大乘期妖圣',
realm: '大乘期',
stage: '初级',
level: 95,
health: 60000,
maxHealth: 60000,
attack: 4200,
defense: 2600,
speed: 550,
control: 3000,
element: '火',
expReward: 550,
pointsReward: 1500000,
dropItems: [
{ type: 'pill', id: 'cultivation_pill_7', chance: 0.05 },
{ type: 'pill', id: 'special_pill_7', chance: 0.05 },
{ type: 'pill', id: 'realm_pill_7', chance: 0.05 },
{ type: 'skill', id: 'skill_thunder_7', chance: 0.05 },
{ type: 'skill', id: 'skill_wind_7', chance: 0.05 },
{ type: 'skill', id: 'skill_yin_7', chance: 0.05 },
{ type: 'skill', id: 'skill_yang_7', chance: 0.05 },
{ type: 'points', amount: 300000, chance: 0.65 }
],
description: '大乘期的妖圣,几乎达到凡间力量的巅峰,掌控焚天烈焰。'
},
{
id: 'monster_du_1',
name: '渡劫期魔帝',
realm: '渡劫期',
stage: '初级',
level: 98,
health: 80000,
maxHealth: 80000,
attack: 5000,
defense: 3000,
speed: 600,
control: 3500,
element: '混沌',
expReward: 700,
pointsReward: 2000000,
dropItems: [
{ type: 'pill', id: 'attack_pill_8', chance: 0.05 },
{ type: 'pill', id: 'defense_pill_8', chance: 0.05 },
{ type: 'pill', id: 'speed_boost_pill_8', chance: 0.05 },
{ type: 'pill', id: 'control_pill_8', chance: 0.05 },
{ type: 'skill', id: 'skill_elemental_8', chance: 0.05 },
{ type: 'skill', id: 'skill_space_8', chance: 0.05 },
{ type: 'skill', id: 'skill_time_8', chance: 0.05 },
{ type: 'points', amount: 500000, chance: 0.65 }
],
description: '渡劫期的魔帝,即将飞升魔界的存在,掌握混沌之力。'
},
{
id: 'monster_zhen_1',
name: '真仙级仙将',
realm: '真仙',
stage: '初级',
level: 100,
health: 100000,
maxHealth: 100000,
attack: 6000,
defense: 3500,
speed: 650,
control: 4000,
element: '光',
expReward: 900,
pointsReward: 3000000,
dropItems: [
{ type: 'pill', id: 'speed_pill_9', chance: 0.01 },
{ type: 'pill', id: 'attack_pill_9', chance: 0.01 },
{ type: 'pill', id: 'defense_pill_9', chance: 0.01 },
{ type: 'pill', id: 'speed_boost_pill_9', chance: 0.01 },
{ type: 'pill', id: 'control_pill_9', chance: 0.01 },
{ type: 'pill', id: 'breakthrough_pill_9', chance: 0.01 },
{ type: 'pill', id: 'realm_pill_9', chance: 0.01 },
{ type: 'pill', id: 'cultivation_pill_9', chance: 0.01 },
{ type: 'pill', id: 'attribute_pill_9', chance: 0.01 },
{ type: 'pill', id: 'special_pill_9', chance: 0.01 },
{ type: 'skill', id: 'skill_chaos_9', chance: 0.01 },
{ type: 'skill', id: 'skill_dao_9', chance: 0.01 },
{ type: 'skill', id: 'skill_creation_9', chance: 0.01 },
{ type: 'points', amount: 800000, chance: 0.87 }
],
description: '真仙级的仙将,来自仙界的守卫者,实力远超凡人想象。'
},
{
id: 'monster_xuan_1',
name: '玄仙级仙官',
realm: '玄仙',
stage: '初级',
level: 105,
health: 120000,
maxHealth: 120000,
attack: 7000,
defense: 4000,
speed: 700,
control: 4500,
element: '阴阳',
expReward: 1100,
pointsReward: 4000000,
dropItems: [
{ type: 'pill', id: 'speed_pill_9', chance: 0.02 },
{ type: 'pill', id: 'attack_pill_9', chance: 0.02 },
{ type: 'pill', id: 'defense_pill_9', chance: 0.02 },
{ type: 'pill', id: 'speed_boost_pill_9', chance: 0.02 },
{ type: 'pill', id: 'control_pill_9', chance: 0.02 },
{ type: 'pill', id: 'breakthrough_pill_9', chance: 0.02 },
{ type: 'pill', id: 'realm_pill_9', chance: 0.02 },
{ type: 'pill', id: 'cultivation_pill_9', chance: 0.02 },
{ type: 'pill', id: 'attribute_pill_9', chance: 0.02 },
{ type: 'pill', id: 'special_pill_9', chance: 0.02 },
{ type: 'skill', id: 'skill_chaos_9', chance: 0.02 },
{ type: 'skill', id: 'skill_dao_9', chance: 0.02 },
{ type: 'skill', id: 'skill_creation_9', chance: 0.02 },
{ type: 'points', amount: 1000000, chance: 0.74 }
],
description: '玄仙级的仙官,仙界的中层管理者,掌握阴阳法则。'
},
{
id: 'monster_jin_1',
name: '金仙级仙王',
realm: '金仙',
stage: '初级',
level: 110,
health: 150000,
maxHealth: 150000,
attack: 8000,
defense: 4500,
speed: 750,
control: 5000,
element: '金',
expReward: 1300,
pointsReward: 5000000,
dropItems: [
{ type: 'pill', id: 'speed_pill_9', chance: 0.03 },
{ type: 'pill', id: 'attack_pill_9', chance: 0.03 },
{ type: 'pill', id: 'defense_pill_9', chance: 0.03 },
{ type: 'pill', id: 'speed_boost_pill_9', chance: 0.03 },
{ type: 'pill', id: 'control_pill_9', chance: 0.03 },
{ type: 'pill', id: 'breakthrough_pill_9', chance: 0.03 },
{ type: 'pill', id: 'realm_pill_9', chance: 0.03 },
{ type: 'pill', id: 'cultivation_pill_9', chance: 0.03 },
{ type: 'pill', id: 'attribute_pill_9', chance: 0.03 },
{ type: 'pill', id: 'special_pill_9', chance: 0.03 },
{ type: 'skill', id: 'skill_chaos_9', chance: 0.03 },
{ type: 'skill', id: 'skill_dao_9', chance: 0.03 },
{ type: 'skill', id: 'skill_creation_9', chance: 0.03 },
{ type: 'points', amount: 1500000, chance: 0.61 }
],
description: '金仙级的仙王,仙界的统治者之一,拥有不朽金身。'
},
{
id: 'monster_zun_1',
name: '仙尊级道祖',
realm: '仙尊',
stage: '初级',
level: 120,
health: 200000,
maxHealth: 200000,
attack: 10000,
defense: 5000,
speed: 800,
control: 6000,
element: '道',
expReward: 1500,
pointsReward: 10000000,
dropItems: [
{ type: 'pill', id: 'speed_pill_9', chance: 0.04 },
{ type: 'pill', id: 'attack_pill_9', chance: 0.04 },
{ type: 'pill', id: 'defense_pill_9', chance: 0.04 },
{ type: 'pill', id: 'speed_boost_pill_9', chance: 0.04 },
{ type: 'pill', id: 'control_pill_9', chance: 0.04 },
{ type: 'pill', id: 'breakthrough_pill_9', chance: 0.04 },
{ type: 'pill', id: 'realm_pill_9', chance: 0.04 },
{ type: 'pill', id: 'cultivation_pill_9', chance: 0.04 },
{ type: 'pill', id: 'attribute_pill_9', chance: 0.04 },
{ type: 'pill', id: 'special_pill_9', chance: 0.04 },
{ type: 'skill', id: 'skill_chaos_9', chance: 0.04 },
{ type: 'skill', id: 'skill_dao_9', chance: 0.04 },
{ type: 'skill', id: 'skill_creation_9', chance: 0.04 },
{ type: 'points', amount: 3000000, chance: 0.48 }
],
description: '仙尊级的道祖,接近天道存在,言出法随,掌控法则。'
}
];
const shopItems = [
{
id: 'health_potion_1',
name: '小还丹',
description: '恢复1000点生命值',
type: 'recovery',
price: 1000,
effect: { type: 'health', value: 1000 }
},
{
id: 'health_potion_2',
name: '大还丹',
description: '恢复10000点生命值',
type: 'recovery',
price: 10000,
effect: { type: 'health', value: 10000 }
},
{
id: 'health_potion_3',
name: '还魂丹',
description: '恢复100000点生命值',
type: 'recovery',
price: 50000,
effect: { type: 'health', value: 100000 }
},
{
id: 'health_potion_4',
name: '九转还魂丹',
description: '恢复1000000点生命值',
type: 'recovery',
price: 500000,
effect: { type: 'health', value: 1000000 }
},
{
id: 'cultivation_potion_1',
name: '修为丹',
description: '增加50点修为',
type: 'pill',
price: 10000,
effect: { type: 'cultivation', value: 50 }
},
{
id: 'cultivation_potion_2',
name: '高级修为丹',
description: '增加100点修为',
type: 'pill',
price: 15000,
effect: { type: 'cultivation', value: 100 }
}
];
function getRandomLingGen() {
const probabilities = {
'天灵根': 0.005,
'隐灵根': 0.002,
'变异灵根': 0.01,
'双灵根': 0.1,
'三灵根': 0.3,
'四灵根': 0.4,
'五灵根': 0.183
};
const rand = Math.random();
let cumulativeProbability = 0;
let selectedType = '五灵根';
for (const [type, probability] of Object.entries(probabilities)) {
cumulativeProbability += probability;
if (rand <= cumulativeProbability) {
selectedType = type;
break;
}
}
const lingGensOfType = lingGenData.filter(lg => lg.type === selectedType);
const randomIndex = Math.floor(Math.random() * lingGensOfType.length);
return lingGensOfType[randomIndex];
}
function getRandomSpecialBody() {
if (Math.random() <= 0.05) {
const randomIndex = Math.floor(Math.random() * specialBodyData.length);
return specialBodyData[randomIndex];
}
return null;
}
function getNextRealm(currentRealm, currentStage) {
const currentRealmIndex = realmData.findIndex(r => r.name === currentRealm);
if (currentRealmIndex === -1)
return null;
const currentRealmData = realmData[currentRealmIndex];
const currentStageIndex = currentRealmData.stages.indexOf(currentStage);
if (currentStageIndex < currentRealmData.stages.length - 1) {
return {
realm: currentRealm,
stage: currentRealmData.stages[currentStageIndex + 1]
};
}
if (currentRealmIndex < realmData.length - 1) {
return {
realm: realmData[currentRealmIndex + 1].name,
stage: realmData[currentRealmIndex + 1].stages[0]
};
}
return null;
}
function getMaxCultivation(realm, stage) {
const realmInfo = realmData.find(r => r.name === realm);
if (!realmInfo)
return 100;
const stageIndex = realmInfo.stages.indexOf(stage);
const baseValue = realmInfo.cultivationRequired;
switch (stageIndex) {
case 0:
return baseValue * 0.25;
case 1:
return baseValue * 0.5;
case 2:
return baseValue * 0.75;
case 3:
return baseValue;
default:
return baseValue;
}
}
function calculateBreakthroughChance(user) {
if (!user.xiuxian)
return 0;
const xiuxian = user.xiuxian;
const realmInfo = xiuxian ? realmData.find(r => r.name === xiuxian.realm) : undefined;
if (!realmInfo)
return 0.6;
let baseChance = 0.6;
const difficultyPenalty = Math.sqrt(realmInfo.breakthroughDifficulty - 1) * 0.15;
baseChance -= difficultyPenalty;
baseChance += user.xiuxian.breakthroughBonus;
const pillBonus = user.xiuxian.temporaryEffects.reduce((sum, effect) => {
if (effect.type === 'breakthroughBonus') {
return sum + effect.value;
}
return sum;
}, 0);
baseChance += pillBonus;
baseChance += user.xiuxian.breakthroughFailed * 0.05;
return Math.max(0.05, Math.min(0.95, baseChance));
}
function calculateCultivationSpeed(user) {
if (!user.xiuxian)
return 0;
const baseSpeed = 1.0;
const lingGenBonus = user.xiuxian.cultivationSpeed - 1;
let specialBodyBonus = 0;
if (user.xiuxian.specialBody) {
const specialBody = user.xiuxian?.specialBody ? specialBodyData.find(sb => sb.name === user.xiuxian?.specialBody) : undefined;
if (specialBody) {
specialBodyBonus = specialBody.cultivationSpeed - 1;
}
}
const skillBonus = user.xiuxian.skills.reduce((sum, skill) => {
if (skill.learned && skill.active && skill.effect.type === 'cultivation') {
return sum + skill.effect.value;
}
return sum;
}, 0);
const pillBonus = user.xiuxian.temporaryEffects.reduce((sum, effect) => {
if (effect.type === 'cultivationSpeed') {
return sum + effect.value;
}
return sum;
}, 0);
const totalBonus = Math.min(4.0, lingGenBonus + specialBodyBonus + skillBonus + pillBonus);
return baseSpeed + totalBonus;
}
function parseSpecialAbility(specialAbility) {
if (!specialAbility)
return null;
const abilityMap = {
'阴阳术法': { type: 'yinYang', value: 0.5 },
'灵气生成': { type: 'cultivationSpeed', value: 0.3 },
'阴系法术': { type: 'yin', value: 0.4 },
'阳系法术': { type: 'yang', value: 0.4 },
'法则感悟': { type: 'breakthroughBonus', value: 0.3 },
'全系功法': { type: 'all', value: 0.2 },
'剑系法术': { type: 'attack', value: 0.3 },
'炼丹加成': { type: 'alchemy', value: 0.4 }
};
return abilityMap[specialAbility] || null;
}
function calculateElementAdvantage(attackElement, defenseElement) {
const validElements = Object.keys(elementRelations);
if (!validElements.includes(attackElement) || !validElements.includes(defenseElement)) {
return 0;
}
if (elementRelations[attackElement].advantage.includes(defenseElement)) {
return 0.3;
}
if (elementRelations[attackElement].disadvantage.includes(defenseElement)) {
return -0.2;
}
return 0;
}
function calculateBattleDamageToMonster(user, monster) {
if (!user.xiuxian)
return 0;
const baseDamage = user.xiuxian.baseAttack || 50;
const userAttackBonus = user.xiuxian.attack;
const skillAttackBonus = user.xiuxian.skills.reduce((sum, skill) => {
if (skill.learned && skill.active && skill.effect.type === 'attack') {
return sum + skill.effect.value;
}
return sum;
}, 0);
const pillAttackBonus = user.xiuxian.temporaryEffects.reduce((sum, effect) => {
if (effect.type === 'attack') {
return sum + effect.value;
}
return sum;
}, 0);
const lingGen = user.xiuxian?.lingGen ? lingGenData.find(lg => lg.name === user.xiuxian?.lingGen) : undefined;
const mainElement = lingGen ? lingGen.name.replace('灵根', '').replace('天', '').replace('变异', '').replace('双', '').replace('三', '').replace('四', '').replace('五', '') : '';
const attributeBonus = user.xiuxian.attributes[mainElement] ? user.xiuxian.attributes[mainElement] * 0.01 : 0;
let specialBodyBonus = 0;
if (user.xiuxian.specialBody) {
const ability = parseSpecialAbility(user.xiuxian.specialBody);
if (ability && (ability.type === 'attack' || ability.type === 'all')) {
specialBodyBonus += ability.value;
}
}
const elementBonus = calculateElementAdvantage(mainElement, monster.element);
const totalAttackBonus = userAttackBonus + skillAttackBonus + pillAttackBonus + attributeBonus + specialBodyBonus + elementBonus;
const userControl = user.xiuxian.control;
const userBaseControl = user.xiuxian.baseControl || 10;
const effectiveControl = userBaseControl * (1 + userControl);
const controlBonus = effectiveControl * 0.01;
const defenseFactor = Math.max(0.1, 1 - (monster.defense / (monster.defense + 200 + effectiveControl * 0.5)));
const rawDamage = baseDamage * (1 + totalAttackBonus) * defenseFactor;
const minDamage = rawDamage * (1 - 0.2 + controlBonus);
const maxDamage = rawDamage * (1 + 0.2 - controlBonus);
const finalDamage = minDamage + Math.random() * (maxDamage - minDamage);
return Math.max(1, finalDamage);
}
function calculateMonsterDamage(monster, user) {
if (!user.xiuxian)
return 0;
const baseDamage = monster.attack;
const lingGen = user.xiuxian?.lingGen ? lingGenData.find(lg => lg.name === user.xiuxian?.lingGen) : undefined;
const userElement = lingGen ? lingGen.name.replace('灵根', '').replace('天', '').replace('变异', '').replace('双', '').replace('三', '').replace('四', '').replace('五', '') : '';
const elementBonus = calculateElementAdvantage(monster.element, userElement);
const userDefenseBonus = user.xiuxian.defense;
const skillDefenseBonus = user.xiuxian.skills.reduce((sum, skill) => {
if (skill.learned && skill.active && skill.effect.type === 'defense') {
return sum + skill.effect.value;
}
return sum;
}, 0);
const pillDefenseBonus = user.xiuxian.temporaryEffects.reduce((sum, effect) => {
if (effect.type === 'defense') {
return sum + effect.value;
}
return sum;
}, 0);
const baseDefense = user.xiuxian.baseDefense || 30;
const totalDefenseBonus = userDefenseBonus + skillDefenseBonus + pillDefenseBonus;
const effectiveDefense = baseDefense * (1 + totalDefenseBonus);
const defenseFactor = Math.max(0.1, 1 - (effectiveDefense / (effectiveDefense + 200)));
const userControl = user.xiuxian.control;
const userBaseControl = user.xiuxian.baseControl || 10;
const effectiveControl = userBaseControl * (1 + userControl);
const controlReduction = effectiveControl * 0.01;
const rawDamage = baseDamage * (1 + elementBonus) * defenseFactor;
const minDamage = rawDamage * (1 - 0.2 + controlReduction);
const maxDamage = rawDamage * (1 + 0.2 - controlReduction);
const finalDamage = minDamage + Math.random() * (maxDamage - minDamage);
return Math.max(1, finalDamage);
}
function processDrops(dropItems) {
const drops = [];
if (!dropItems) {
return drops;
}
for (const item of dropItems) {
if (Math.random() < item.chance) {
try {
if (item.type === 'points') {
drops.push({
type: 'points',
amount: item.amount || 0
});
}
else {
drops.push({
type: item.type,
id: item.id || ''
});
}
}
catch (e) {
console.error(`处理掉落物品时发生错误:${e instanceof Error ? e.message : String(e)}`);
return [];
}
}
}
return drops;
}
function processExpiredEffects(user) {
const now = Date.now();
if (user.xiuxian && user.xiuxian.temporaryEffects) {
user.xiuxian.temporaryEffects = user.xiuxian.temporaryEffects.filter((effect) => effect.expiresAt > now);
}
}
function addTemporaryEffect(user, type, value, duration, source) {
if (!user.xiuxian)
return;
if (!user.xiuxian.temporaryEffects) {
user.xiuxian.temporaryEffects = [];
}
const actualDuration = duration || 3600;
user.xiuxian.temporaryEffects.push({
type,
value,
expiresAt: Date.now() + actualDuration * 1000,
source
});
}
function applyXiuXianSystem(ctx) {
const xiuxianCmd = ctx.command('修仙 [action:string] [param:string]', '修仙系统 - 踏上仙途,修炼成仙')
.usage('查看: 修仙\n踏入仙途: 修仙 踏入仙途\n修炼: 修仙 修炼\n突破: 修仙 突破\n炼丹: 修仙 炼丹 <丹药名称>\n战斗: 修仙 战斗 <怪物名称>\n功法: 修仙 功法 <功法名称>\n状态: 修仙 状态')
.action(async ({ session }, action, param) => {
if (!session)
return '会话异常';
if (!session.userId)