Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/694f5245-1110-800b-b182-7c2accd50046
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== 你把這段直接丟給 GEMINI(放在武器系統定義區、或至少在 firePlayerWeapon 之前): === <syntaxhighlight lang="js">// --- WEAPON STATS FALLBACK (prevents bullet vanish/crash) --- function getWeaponStats(weaponId){ // If a different function name exists, route to it. if (typeof WEAPONS !== "undefined" && WEAPONS && WEAPONS[weaponId]) return WEAPONS[weaponId]; if (typeof getGunStats === "function") return getGunStats(weaponId); if (typeof getWeaponConfig === "function") return getWeaponConfig(weaponId); // Minimal defaults so firing always works const defaults = { RIFLE: { dmg: 8, fireRate: 6, spread: 0.02, speed: 10, life: 70, pellets: 1 }, SHOTGUN: { dmg: 5, fireRate: 2, spread: 0.18, speed: 9, life: 50, pellets: 6 }, MISSILE: { dmg: 18, fireRate: 1, spread: 0.01, speed: 7, life: 90, pellets: 1, homing: true }, }; return defaults[weaponId] || { dmg: 6, fireRate: 4, spread: 0.05, speed: 9, life: 60, pellets: 1 }; } </syntaxhighlight> ✅ 這段的精神跟你前面救 saferoom 一樣: 先讓 loop 不炸、子彈一定吐得出來,後面再慢慢把武器資料表整理回來。
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)