Comments (2)
Fix #43 #47 #42 outsource accuracy and draw force
from gothicfreeaim.
/* Retrieve draw force scaled between 0 and 100 (percent) */
func int freeAimGetDrawForce() {
// Scale draw time between 0 and 100, see #43
return 100;
};
/* Retrieve aiming accuracy scaled between 0 and 100 (percent). Modify this function to alter accuracy calculation */
func int freeAimGetAccuracy() {
var int accuracy[3]; // Number of factors playing into the accuracy(+1), here: talent [1] and draw force [2]
// Factor 1: Talent (keep in mind that it might be greater than 100)
var oCItem weapon; weapon = Npc_GetEquippedRangedWeapon(hero);
if (weapon.flags &~ ITEM_BOW) { accuracy[1] = hero.HitChance[NPC_TALENT_BOW]; }
else if (weapon.flags &~ ITEM_CROSSBOW) { accuracy[1] = hero.HitChance[NPC_TALENT_CROSSBOW]; }
else { MEM_Error("freeAimGetAccuracy: No valid weapon equipped!"); return -1; }; // Invalid, should never happen
// Factor 2: Draw force
accuracy[2] = freeAimGetDrawForce(); // Already scaled between [0, 100], see above
// Factor X: Add any other factors here e.g. weapon-specific accuracy stats, accuracy talent, ...
// Calculate overall accuracy from all factors (modify the following line for different weighting)
accuracy[0] = (accuracy[1] + accuracy[2])/2; // Here: simple average
// Final accuracy needs to be in [0, 100]
if (accuracy[0] > 100) { accuracy[0] = 100; } else if (accuracy[0] < 0) { accuracy[0] = 0; };
return accuracy[0];
};
/* ... */
var int accuracy; accuracy = freeAimGetAccuracy();
from gothicfreeaim.
Related Issues (20)
- Update project architecture diagram
- Finish wiki
- Decrease fine scattering angle HOT 1
- Decrease secondary modulation of accuracy HOT 1
- Crash on loading related to oCNpc::SetBodyState HOT 2
- Projectiles are not destroyed when reuse-feature is disabled in Gothic 1
- Simplify categorizing spells for drawing reticle in config
- Remove debugging visualizations (Draw3D) from default initialization
- Low FPS prevent aiming with crossbow T2 stance
- Crash when initializing GFA_SPELLS without GFA_STRAFING
- Focus mode is wrong when loading game in fight mode HOT 1
- Display reticle in virtual coordinates HOT 1
- Move "no focus no aim" to INI
- [Returning 2.0] Game crashes after intros while using Ninja GFA patch HOT 2
- Provide projectile pointer to config function HOT 1
- Add safety checks for common fixes HOT 1
- ITEM_FOCUS HOT 1
- New idea - free hiting
- [Gothic Multiplayer] AimRay intersection with player's camera bbox HOT 4
- [Singleplayer] FPS Drops / [Multiplayer] Not able to connect HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gothicfreeaim.